--- Log opened Thu Mar 06 00:00:08 2014 | ||
stekern | 'NULL' is overrated, why not just use the more beautiful '0'? | 04:24 |
---|---|---|
dalias | i agree completely | 04:30 |
dalias | NULL is also misleading because it doesn't have to be defined with pointer type, and even when it is, the type is often not what you want | 04:31 |
dalias | for example using NULL in execl is wrong | 04:31 |
dalias | it needs to be (char *)NULL or (simpler) (char *)0 | 04:31 |
LoneTech | NULL is a shoddy workaround for two things: 0 looks like an integer but is defined to parse as nil, and compilers often bark at you if a non-pointer or wrong sort of pointer is passed - except if it's void, because the only use of a void pointer is as an alias for something that makes sense only to other code. | 09:55 |
ams | dalias: sorry? NULL is always (void*)0 or equivalent | 09:59 |
ams | and ofcourse using NULL for execl is wrong; it takes two const char *'s, NULL is not const | 10:00 |
ams | rather the problem is that C is a brain damaged language :-) | 10:02 |
LoneTech | yep | 10:03 |
ams | though wonderful | 10:05 |
dalias | ams, no it's not. it's an implementation-defined null pointer constant | 15:54 |
dalias | which means it's either an integer constant expression with value 0, or such an expression cast to void * | 15:54 |
dalias | and the const issue you mentioned does not exist | 15:55 |
dalias | char * is valid in place of const char * there | 15:55 |
olofk | I always defines NULL as 1. It makes the code slightly faster, but sometimes less stable | 15:56 |
ams | dalias: no, wrong. | 15:57 |
ams | dalias: section 6.3.2.3, An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant. | 15:58 |
ams | ++olofk | 15:59 |
ams | dalias: there is nothing implementation defined about it | 16:00 |
dalias | ams, null pointer constant is not implementation-defined | 16:09 |
dalias | it's very strictly defined | 16:09 |
dalias | NULL is implementation-defined | 16:09 |
dalias | it must be a null pointer constant, but it can be any implementation-defined choice of null pointer constant | 16:10 |
dalias | C99 7.17 Common definitions <stddef.h> paragraph 3 | 16:10 |
dalias | "The macros are NULL which expands to an implementation-defined null pointer constant; and ..." | 16:11 |
ams | dalias: C11 and POSIX make it non-implementation defined. | 16:11 |
dalias | oh? i'm aware of the additional requirement in posix but not c11 | 16:12 |
ams | gotta run ... | 16:12 |
dalias | and you're wrong | 16:13 |
dalias | C11 says the same thing on stddef.h | 16:13 |
dalias | it's 7.19 now instead of 7.17 | 16:13 |
dalias | but the text is the same | 16:13 |
ams | then maybe i am conflating it with poosix, or one of the tc's | 16:15 |
ams | <--- not here. | 16:16 |
-!- FreezingAlt is now known as FreezingCold | 19:29 | |
blueCmd | olofk: mind blowing amount of answers to your email | 19:52 |
blueCmd | olofk: a coworker tells us to break it down in patches and just submit it | 20:08 |
blueCmd | olofk: like one patch to remove the or32 stuff and try to split it up, if it makes sense | 20:12 |
olofk | ugh... I don't feel comfortable with dividing it into feature patches. I hardly know what binutils does | 21:24 |
olofk | blueCmd: Are you working with an italian guy called Diego, btw? | 21:24 |
olofk | stekern: What was the state of your FuesSoC sockit port? | 21:31 |
blueCmd | olofk: i am not | 21:50 |
blueCmd | olofk: I am working with an italian guy with a first name starting with the letter F | 21:51 |
blueCmd | olofk: I can probably do a lot of that patch splitting | 21:52 |
--- Log closed Fri Mar 07 00:00:09 2014 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!