Use of #if DEBUG in reent.h
Christian Groessler
chris@groessler.org
Wed Jan 4 14:08:00 GMT 2017
On 01/04/17 15:05, Eric Blake wrote:
> On 01/04/2017 04:14 AM, Freddie Chopin wrote:
>> Hi!
>>
>> Maybe it would be ok to change the offending line to:
>>
>> #if defined(DEBUG) && DEBUG != 0
>>
>> This way the old behaviour should be retained in most of the cases.
>> >From what I've read, if you add "-DDEBUG" to GCC flags, it is
>> equivalent to "-DDEBUG=1".
> Not by my experience. There's a difference to being defined to the
> empty string (-DDEBUG on the command line corresponds to '#define DEBUG'
> in source) vs. an explicit string (-DDEBUG=1 corresponds to '#define
> DEBUG 1').
No.
$ gcc -dM -E - < /dev/null | grep DEBUG
$ gcc -DDEBUG -dM -E - < /dev/null | grep DEBUG
#define DEBUG 1
$
regards,
chris
More information about the Newlib
mailing list