Re: [Development] 0 vs. NULL

2015-10-13 Thread René J . V . Bertin
non-existent) implicit > > pointer_to_void -> some_pointer_type > > IS NOT, and compiler, issuing error messages will help you to avoid some > troubles. > > > From: René J.V. Bertin > Sent: Friday, October 09, 2015 5:51 PM > T

Re: [Development] 0 vs. NULL

2015-10-09 Thread Matthew Woehlke
On 2015-10-09 11:51, René J.V. Bertin wrote: > On Friday October 09 2015 13:58:37 Pocheptsov Timur wrote: >> And yes, void * in C++ can be indeed considered generic, because >> you can do this: >> >> int * p = ... void * pv = p; > > Coming from C I have some trouble with that concept of generic >

Re: [Development] 0 vs. NULL

2015-10-09 Thread Pocheptsov Timur
plicit pointer_to_void -> some_pointer_type IS NOT, and compiler, issuing error messages will help you to avoid some troubles. From: René J.V. Bertin Sent: Friday, October 09, 2015 5:51 PM To: Pocheptsov Timur Cc: development@qt-project.org Subject: Re

Re: [Development] 0 vs. NULL

2015-10-09 Thread René J . V . Bertin
On Friday October 09 2015 13:58:37 Pocheptsov Timur wrote: > if NULL was (void *)0 - you'd have a compilation error in C++, since there is > no such implicit conversion. > > And yes, void * in C++ can be indeed considered generic, because you can do > this: > > int * p = ... > void * pv = p;

Re: [Development] 0 vs. NULL

2015-10-09 Thread Pocheptsov Timur
v = p; From: development-bounces+timur.pocheptsov=theqtcompany@qt-project.org on behalf of René J. V. Bertin Sent: Friday, October 09, 2015 3:51 PM To: development@qt-project.org Subject: Re: [Development] 0 vs. NULL Thiago Macieira wrote: I missed this message. &

Re: [Development] 0 vs. NULL

2015-10-09 Thread René J . V . Bertin
Thiago Macieira wrote: I missed this message. > "The macro NULL is an implementation-defined C++ null pointer constant in this > International Standard(180)" > > And the note reads > > "180)Possible definitions include 0 and 0L, but not (void*)0." Does the note say why or is it just an arbitr

Re: [Development] 0 vs. NULL

2015-10-09 Thread Marc Mutz
On Thursday 08 October 2015 11:55:52 André Somers wrote: [...] > Nowadays, for code that you won't need to compile with non C++/11 > complient compilers, I'd recommend to use nullptr instead. At least, > nullptr will always be interpretted as a pointer. [...] Seconded. I'd go so far as to use null

Re: [Development] 0 vs. NULL

2015-10-08 Thread Thiago Macieira
On Thursday 08 October 2015 13:01:50 René J.V. Bertin wrote: > > and I'm not entirely sure about NULL, for that matter (it might just > > expand to 0, at least in C, but perhaps not in C++). > > Given how NULL is usally defined as ((void*)0) or equivalent, there should > not be any issues in that

Re: [Development] 0 vs. NULL

2015-10-08 Thread René J . V . Bertin
On Thursday October 08 2015 11:12:35 Welbourne Edward wrote: > Perhaps I misunderstood ! I'm relatively new to Qt myself. Your email address suggested otherwise ;) > I'm not convinced I want to rely on that. > Some compilers might be better at it than others ... You'd probably better not thoug

Re: [Development] 0 vs. NULL

2015-10-08 Thread Welbourne Edward
>>> Did I simply hit a "feature" Qt won't ever encounter because it >>> doesn't use C (nor va_arg)? is what I was referring back to when I said: >> Well, it's nice to hear we don't use var-args. Perhaps I misunderstood ! I'm relatively new to Qt myself. On grep-ing code, I see we do in fact us

Re: [Development] 0 vs. NULL

2015-10-08 Thread René J . V . Bertin
On Thursday October 08 2015 09:52:14 Welbourne Edward wrote: > > A bit of a generic question, [...] about the preferred use of 0 instead of > > NULL. > > One of the habits of C++ that a C programmer always finds weird. Yeah, especially when they're used to being annoyed about all those "redunda

Re: [Development] 0 vs. NULL

2015-10-08 Thread André Somers
Op 8-10-2015 om 11:27 schreef René J.V. Bertin: > Hi, > > A bit of a generic question, for my personal education. I saw a comment in a > code review recently (one related to making Qt build on OS X 10.11, probably) > about the preferred use of 0 instead of NULL. > > I didn't realise at first why

Re: [Development] 0 vs. NULL

2015-10-08 Thread Welbourne Edward
> A bit of a generic question, [...] about the preferred use of 0 instead of > NULL. One of the habits of C++ that a C programmer always finds weird. > Now I remembered having to modify some of my own code to use NULL > instead of 0 to avoid crashing, on 64bit (capable) hardware. I cannot > reme

[Development] 0 vs. NULL

2015-10-08 Thread René J . V . Bertin
Hi, A bit of a generic question, for my personal education. I saw a comment in a code review recently (one related to making Qt build on OS X 10.11, probably) about the preferred use of 0 instead of NULL. I didn't realise at first why that remark surprised me somewhere. Now I remembered having