Please no // comments in C source (ecpg)

Started by Zeugswetter Andreas SBover 25 years ago5 messages
#1Zeugswetter Andreas SB
ZeugswetterA@wien.spardat.at

Subj, sais it all,

Please don't use C++ style comments in C source files.
It does not work for all ports.

Currently in connect.c.

Thanks
Andreas

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Zeugswetter Andreas SB (#1)
Re: Please no // comments in C source (ecpg)

Fixed.

[ Charset ISO-8859-1 unsupported, converting... ]

Subj, sais it all,

Please don't use C++ style comments in C source files.
It does not work for all ports.

Currently in connect.c.

Thanks
Andreas

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Peter Mount
peter@retep.org.uk
In reply to: Zeugswetter Andreas SB (#1)
Re: Please no // comments in C source (ecpg)

On Mon, 25 Sep 2000, Zeugswetter Andreas SB wrote:

Subj, sais it all,

Please don't use C++ style comments in C source files.
It does not work for all ports.

AFAIK, only GCC supports // as comments.

Currently in connect.c.

And in the java areas, but that doesn't count here ;-)

--
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/

#4Zeugswetter Andreas SB
ZeugswetterA@wien.spardat.at
In reply to: Peter Mount (#3)
AW: Please no // comments in C source (ecpg)

Please don't use C++ style comments in C source files.
It does not work for all ports.

AFAIK, only GCC supports // as comments.

// comments are legal as of Standard C 1999, so expect more
compilers to
accept them silently. (That still doesn't mean we get to use them, of
course.)

Well, xlc (aix compiler) does have a flag to allow // comments,
so if we think that all other compilers support them we can use the flag
in the AIX port, and forget about the issue.

But I guess we better not, and that was why we don't use the flag.
That makes me the dummy that complains from time to time,
since nobody else who compiles snapshots seems to notice :-)

Such is life :-)
Andreas

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zeugswetter Andreas SB (#4)
Re: AW: Please no // comments in C source (ecpg)

Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:

That makes me the dummy that complains from time to time,
since nobody else who compiles snapshots seems to notice :-)

I think most of the regular developers use gcc. It's good to have
people testing with other compilers --- keep it up!

Even though C99 does allow // comments, I agree that we have to keep
them out of portable code for the foreseeable future.

regards, tom lane