[linux-l] C++-Kommentare in C [was: shell skript probleme mit leerzeichen]
Pascal Volk
linux-l at edelhost.de
Do Okt 27 17:20:00 CEST 2005
* Am Do, 27 Okt 2005 schrub Peter Ross:
> [...]
> Ich habe gerade einen Apache2 mit mod_perl etc. unter AIX zum Laufen
> gebracht. Es ist schon aergerlich, wenn man nacharbeiten muss, weil jemand
> in C-Code C++Kommentarsyntax benutzt. Das mag der gcc, aber nicht der
> Systemcompiler von AIX. Und es gibt keine Notwendigkeit fuer C++Kommentare
> im C-Code.
Nöö, der gcc (Vers. 3.{3,4}.x. 4.0.x) mag 'C++-Kommentare' in C auch nicht
direkt.
pvo at el-presidente tmp $ cat hello.c
#include <stdio.h>
int main(void)
{
// gibt hello aus
printf ("hello\n");
return 0;
}
pvo at el-presidente tmp $ gcc -Wall -pedantic -o hello hello.c
hello.c:4:5: warning: C++ style comments are not allowed in ISO C90
hello.c:4:5: warning: (this will be reported only once per input file)
Man muss dem gcc schon sagen, dass das vorliegende File nicht C90-Code,
sonder C99-Code enthält:
pvo at el-presidente tmp $ gcc -std=c99 -Wall -pedantic -o hello hello.c
pvo at el-presidente tmp $ ^^^^^^^^
Kann man dem AIX-Systemcompiler nicht sagen welchem Standard der vorliegende
Code angeblich entspricht?
Gruß
Pascal
--
rm -Rfv /tmp/../ && echo "are you sure???"
Die BeLUG im IRC:
irc://irc.freenode.net/#belug
____ ____ ____ ____ ____ _________ ____ ____ ____ ____ ____ ____
||/ |||j |||o |||i |||n ||| |||# |||b |||e |||l |||u |||g ||
||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 189 bytes
Beschreibung: Digital signature
URL : <https://mlists.in-berlin.de/pipermail/linux-l-mlists.in-berlin.de/attachments/20051027/201adf4b/attachment.sig>
Mehr Informationen über die Mailingliste linux-l