Re: free() and implicit conversion to a function pointer

2017-03-20 Thread Eric Blake
On 03/16/2017 02:24 PM, Hans-Bernhard Bröker wrote: > > The reason this is wrong is that C by design treats data and functions > as living in separate realms, i.e. its virtual machine has a Harvard > architecture. One of the consequences of this is that pointers to > functions and pointers to dat

Re: free() and implicit conversion to a function pointer

2017-03-17 Thread Hans-Bernhard Bröker
Am 17.03.2017 um 09:30 schrieb Corinna Vinschen: On Mar 17 00:49, Hans-Bernhard Bröker wrote: [...] Wasn't that supposed to go to the newlib list where this has been discussed originally? Ah, of course it was. That explains the confusion, too. Sorry for that. I'll repost there. HBB --

Re: free() and implicit conversion to a function pointer

2017-03-17 Thread Corinna Vinschen
On Mar 17 00:49, Hans-Bernhard Bröker wrote: > Am 16.03.2017 um 22:46 schrieb L A Walsh: > > Going by subj and talk below, this is a bit confusing... > > > > But it looks like you are testing 'free' for a value? > > Not really. The idea is to test free for _exixtence_. Which only makes > sense

Re: free() and implicit conversion to a function pointer

2017-03-16 Thread Hans-Bernhard Bröker
Am 16.03.2017 um 22:46 schrieb L A Walsh: Going by subj and talk below, this is a bit confusing... But it looks like you are testing 'free' for a value? Not really. The idea is to test free for _exixtence_. Which only makes sense in case of weak symbol support getting involved. In other s

Re: free() and implicit conversion to a function pointer

2017-03-16 Thread L A Walsh
Going by subj and talk below, this is a bit confusing... But it looks like you are testing 'free' for a value? Isn't standard 'free' declared to take 1 arg and return void? If you aren't talking standard 'free()', then nevermind... Hans-Bernhard Bröker wrote: [Sorry, forgot to reply-all...]

Re: free() and implicit conversion to a function pointer (was: Use of initialized variable in strtod.c)

2017-03-16 Thread Hans-Bernhard Bröker
[Sorry, forgot to reply-all...] Am 15.03.2017 um 23:48 schrieb Jeffrey Walton: Since Coverity is complaining about an implicit conversion, maybe the following will help to avoid the implicit part (and sidestep the finding): if (free != NULL) break; Or perhaps: if ((void*)free