[LLVMdev] About NDEBUG (Cont)

Dale Johannesen dalej at apple.com
Mon Jan 10 11:25:44 PST 2011


On Jan 10, 2011, at 9:29 AMPST, Duncan Sands wrote:

> 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

Use of the name NDEBUG to control assertions comes from the C++ (and C) standards.  I agree this was not a great choice but deviating from the standard would be more confusing than helpful IMO.

> 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
>> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110110/097328b0/attachment.html>


More information about the llvm-dev mailing list