ghfeil@white.toronto.edu (Georg Feil) (12/21/89)
I've noticed that g++ will accept either int printf(const char*, ...); or int printf(const char* ...); But gcc likes only the first one (with the comma). Any reason for this? Which is the preferred usage? Ok, I know it's a trivial point. Georg. -- Georg Feil Internet: ghfeil@white.toronto.edu -or- : georg@sgl.ists.ca ...if all else fails, try: {uunet,pyramid,watmath,utzoo}!utcsri!white!ghfeil ghfeil%white.toronto.edu@relay.cs.net (ARPA)
meissner@skeptic.osf.org (Michael Meissner) (12/22/89)
In article <89Dec20.221311est.27295@snow.white.toronto.edu> ghfeil@white.toronto.edu (Georg Feil) writes: |I've noticed that g++ will accept either | | int printf(const char*, ...); |or | int printf(const char* ...); | |But gcc likes only the first one (with the comma). Any reason for this? |Which is the preferred usage? Basically what happened is C++ came out with the 2nd syntax. The ANSI X3J11 committee decided that they liked prototypes, but that there should be a comma separating the '...' from the other arguments. I was certainly at the meeting when this was changed, but for the life of me, I can't remember why it was changed (it was around the 1st Ft. Lauderdale or the Concord Meetings). C++ version 2.0 added ANSI's syntax, and kept the old syntax as well for backward compatibility. GNU C, being an ANSI C compiler, will only allow the ANSI syntax.