bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #3346] GNUMach: ifdef DEBUG -> ifndef NDEBUG


From: Neal H. Walfield
Subject: [patch #3346] GNUMach: ifdef DEBUG -> ifndef NDEBUG
Date: Tue, 07 Sep 2004 10:35:11 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5

This mail is an automated notification from the patch tracker
 of the project: The GNU Hurd.




/**************************************************************************/
[patch #3346] Full Item Snapshot:

URL: <http://savannah.gnu.org/patch/?func=detailitem&item_id=3346>
Project: The GNU Hurd
Submitted by: Neal H. Walfield
On: Tue 09/07/04 at 14:29

Category:  GNU Mach
Priority:  3 - Low
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Email:  
Status:  Open


Summary:  GNUMach: ifdef DEBUG -> ifndef NDEBUG

Original Submission:  I think it would be useful to turn asserts on when 
building GNU Mach.
One way to go about doing this would be to define DEBUG when
building.  I think it might be useful, however, to be more like the
posix interface and only disable asserts when NDEBUG is defined.

This also helps get rid of some of the warnings:

        warning: extra tokens at end of #endif directive

It also includes a small patch which fixes a bad assert (basically
suggesting that no one has compiled GNU Mach with asserts turned on
for the past few years).

I used the attached shell script to automate the changes, however, I
have verified all of the changes by hand and I have compiled the code
(at least using my configuration which does not include all of the
changed files).

This patch has already proved useful for uncovering one bug and
several potential more.  (Patches and full explanations to follow as I
get to them.)

Thanks.

for i in $(find . -type f -name '*.[chS]' -print0 
                 | xargs -0 grep -E -l -e 'bDEBUGb')
do
  sed 
    -e 
's/^(#[[:blank:]]*if[[:blank:]]*!?[[:blank:]]*)(DEBUG[[:blank:]]*)$/1!N2/g' 
    -e 
's/^(#[[:blank:]]*if[[:blank:]]*!?[[:blank:]]*defined[[:blank:]]*([[:blank:]]*)DEBUG)/1!NDEBUG)/g'
 
    -e 's/^(#[[:blank:]]*if)(def[[:blank:]]*!?)(DEBUG[[:blank:]]*)$/1n2N3/g' 
    -e 
's/^(#[[:blank:]]*(endif|else)[[:blank:]]+)(/*)?([[:blank:]]*!?)DEBUG([[:blank:]]**/)?[[:blank:]]*$/1
 /* NDEBUG *//g' < $i > $i.tmp && mv $i.tmp $i
done





File Attachments
-------------------

-------------------------------------------------------
Date: Tue 09/07/04 at 14:29  Name: debug.diff  Size: 31.34KB   By: neal

http://savannah.gnu.org/patch/download.php?item_id=3346&amp;item_file_id=3646






For detailed info, follow this link:
<http://savannah.gnu.org/patch/?func=detailitem&item_id=3346>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]