Subject: Re: Patches for devel/bcc (Was: Re: Problem with BCC)
To: None <pkgsrc-users@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: pkgsrc-users
Date: 10/03/2006 16:23:26
Pierrick Brossin wrote:
> And check if I did it the right way (I commented out NULL in some files
[...]

Just one thing: Please, refrain from using "//" for comments in C code.  That's
a C++ism which was included in ISO C99. Thus it's not supported by C89
compilers and C99 support is still very incomplete except in newer GCC
compilers which aren't preferable or even available for all platforms.  Since
there aren't any comments anyway, just removing those lines is just as good as
commenting them out. Otherwise the proper way to disable code, looks like this:

/* comment here */
#if 0
...
#endif /* 0 */

replace 0 with an identifier if you disable a specific feature that
might require more of these modifications in several places.

Even C++ and Java could have learned from this. I often see code
like that:

// line 1
// line 2
// line 3
// line 4

Even worse, this is often scattered all over the place, so it's not clear why
something was commented out and which of those belong together. Further, it's
not possible to undo this easily. Of course, the latter does not matter for your
patches. I just want to make clear that this isn't a matter of taste but
maintenance in general.

-- 
Christian