[Nagiosplug-devel] [ nagiosplug-Bugs-1583467 ] C++ comments used in C code
SourceForge.net
noreply at sourceforge.net
Thu Oct 26 23:00:31 CEST 2006
Bugs item #1583467, was opened at 2006-10-24 12:24
Message generated for change (Comment added) made by markus_b
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1583467&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compilation
Group: Release (specify)
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Markus Baertschi (markus_b)
Assigned to: Ton Voon (tonvoon)
Summary: C++ comments used in C code
Initial Comment:
While compiling nagios-plugins-1.4.4 on AIX using the
IBM compiler I'm stumbling over two cases where
C++-style comments '//' in stead of proper C comments
are used '/* */'. The compiler flags these as Syntax
error as this comment style is not allowed in ANSI C.
Replacing the // with /* */ fixes the problem and all
compiles fine.
Here the
"check_disk.c", line 639.3: 1506-046 (S) Syntax error.
639: // return;
"check_http.c", line 277.7: 1506-046 (S) Syntax error.
277: // asprintf (&http_opt_headers, "%s", optarg);
Markus
----------------------------------------------------------------------
>Comment By: Markus Baertschi (markus_b)
Date: 2006-10-26 23:00
Message:
Logged In: YES
user_id=156828
I've had a short look at the gcc option (I suppose you talk
about gcc). There is -pedantic and -Wcomment options which
warn for such things.
http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Warning-Options.html#Warning-Options
Thanks Markus
----------------------------------------------------------------------
Comment By: Ton Voon (tonvoon)
Date: 2006-10-26 22:53
Message:
Logged In: YES
user_id=664364
Markus,
Thanks. Fixed in CVS now.
Does anyone know how to get cpp to flag that we have used // instead of /* ?
Ton
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1583467&group_id=29880
More information about the Devel
mailing list