delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/26/18:48:18

Date: Tue, 26 Jan 1999 18:46:43 -0500
Message-Id: <199901262346.SAA18268@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <36AE4F8A.9DD333DC@mail.utexas.edu> (message from Jeff Perry on
Tue, 26 Jan 1999 17:28:11 -0600)
Subject: Re: Isn't NDEBUG ANSI?
References: <36AE4F8A DOT 9DD333DC AT mail DOT utexas DOT edu>
Reply-To: djgpp AT delorie DOT com

> Doesn't ANSI require NDEBUG to be defined for non-debug builds?

No.

NDEBUG is something that *you* define (or not) to control the
side-effects of the macros in <assert.h>.  There is no correlation
between that and any other option.

You are confusing symbolic debugging with debug code.  Symbolic
debugging is stuff like line numbers, parameter types, and whatnot
that are included in the output executable so that a debugger (like
gdb) can better represent the state of your program at any given time.
Debug code is code that you include in your program while you are
debugging it (like additional printfs or tests for conditions that
shouldn't happen), which you instruct the compiler to not include in
the final build.

The -g option controls symbolic debugging information.

The NDEBUG macro controls debug code defined by the assert() macro.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019