Re: comment style

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 1 Dec 1997 08:51:03 +0000 (GMT)


> -// priv->phyOnline = 1;
> +/* priv->phyOnline = 1; */
>
> The ISO has decided to make C++ comments legal in C.
> This means you should adjust your gcc config, not hack
> the nice new-style comments out of the kernel.

There are specific reasons for making this change. gcc might known that the
_draft_ ISO standard allows C++ comments, the code checking tools I have do
not. I've got nothing against the "new" (read as left out when B was written)
style comments.

> The ISO standardizes C, not obsolete gcc config files.

Wrong tense - you mean "will"

[related syntactic humour item]

It's also capable of causing different results for the same code depending
if that commenting is supported

int x;

x=2//**/
-1;

if(x==1)
{
printf("Compiled with a C++ compiler.. You lose\n");
exit(1);
}