[LLVMdev] About NDEBUG (Cont)

Duncan Sands baldrick at free.fr
Mon Jan 10 09:29:49 PST 2011


Hi Li Qingan,

> Thanks for your last reply.
> I have made a critical mistake when I stated my question in last email.
> I built llvm in debug mode, but the NDEBUG seemed to be still defined, such that
> the -debug option is not enabled.
> I have restated my configuration below.

you need to configure with --enable-assertions
In spite of the name, NDEBUG is not related to optimization or debugging
symbols, it means that checking (aka assertions) are disabled.  Probably
it should be renamed to NASSERT

Ciao, Duncan.

> Looking forwards to your reply.
>
>
>
>
>
> Hi Li Qingan,
>
>>  I have built and installed llvm-2.8 in debug mode using:
>>
>> >SRC_DIR/configure --prefix=INS_DIR --enable-debug-runtime --disable-optimized
>>  --enable-debug-symbols
>>
>> >make install
>>
>>
>>  It seems theNDEBUGcontrols a lot of print-out of debug information, by using
>>  DEBUG() or dbgs().
>>
>>  And it is said thatNDEBUGis in enabled in debug mode, but I find it does not
>>  work and the -debug option is not recognized. How should I enableNDEBUGor
>>  enable DEBUG() and dbgs()? Should I defineNDEBUGin the .cpp files related,
>>  when I need the debug information?
>
> actually it is the opposite:NDEBUGis enabled when not in debug mode.  The "N" in
> NDEBUGstands for "Not".
>
> Ciao, Duncan.
> --
> Best regards,
>
> Li Qingan
>




More information about the llvm-dev mailing list