Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Is cc broken on OSF/1 and ULTRIX?
@ 1994-10-12 14:00 Dan Pop
  1994-10-12 15:39 ` Ron Natalie
  1994-10-12 17:46 ` Rick Murphy
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Pop @ 1994-10-12 14:00 UTC (permalink / raw)


    ues5:~/tmp 25> cat test.c
    #include <stdio.h>

    main()
    {
    int i;

    i = 4 //* harmless comment here */ 2
	    ;
    printf("%d\n", i);
    return 0;
    }
    ues5:~/tmp 26> cc test.c
    ues5:~/tmp 27> ./a.out 
    4
    ues5:~/tmp 28> c89 test.c
    ues5:~/tmp 29> ./a.out 
    2
    ues5:~/tmp 30> uname -a
    OSF1 ues5.cern.ch V2.1 250 alpha

I got the same results on ULTRIX, too.

c89 does the right thing, but cc doesn't. C++ style comments are not
supported by either K&R or ANSI C and this feature (I'd call it bug)
is not documented in the man page.

cc on AIX, Solaris, SunOS, IRIX, HPUX and Domain/OS behaves correctly.
Will DEC fix its cc?

Dan
--
Dan Pop 
CERN, CN Division
Email: danpop@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is cc broken on OSF/1 and ULTRIX?
  1994-10-12 14:00 Is cc broken on OSF/1 and ULTRIX? Dan Pop
@ 1994-10-12 15:39 ` Ron Natalie
  1994-10-13 15:29   ` Wayne Scott
  1994-10-12 17:46 ` Rick Murphy
  1 sibling, 1 reply; 5+ messages in thread
From: Ron Natalie @ 1994-10-12 15:39 UTC (permalink / raw)


Dan Pop (danpop@cernapo.cern.ch) wrote:
: c89 does the right thing, but cc doesn't. C++ style comments are not
: supported by either K&R or ANSI C and this feature (I'd call it bug)
: is not documented in the man page.

If you want standard behavior out of the DEC compiler, it behooves you
to turn on the -std1 flag.

-Ron


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is cc broken on OSF/1 and ULTRIX?
  1994-10-12 14:00 Is cc broken on OSF/1 and ULTRIX? Dan Pop
  1994-10-12 15:39 ` Ron Natalie
@ 1994-10-12 17:46 ` Rick Murphy
  1994-10-12 22:35   ` Dan Pop
  1 sibling, 1 reply; 5+ messages in thread
From: Rick Murphy @ 1994-10-12 17:46 UTC (permalink / raw)


In article <CxKC80.5xr@news.cern.ch> danpop@cernapo.cern.ch (Dan Pop) writes:
>c89 does the right thing, but cc doesn't. C++ style comments are not
>supported by either K&R or ANSI C and this feature (I'd call it bug)
>is not documented in the man page.

See the c preprocessor manpage -

  The cpp preprocessor accepts C++-style end of line comments (//).  This
  means that everything following the two slashes (//) to the end of the line
  in which they appear is considered as a comment.

>cc on AIX, Solaris, SunOS, IRIX, HPUX and Domain/OS behaves correctly.
>Will DEC fix its cc?
See above. Using   cc -std1 works `correctly' as well.
	-Rick
-- 
Rick Murphy, WA1SPT/4			Washington Federal Programs Office
Domain:  murphy@dco.dec.com		 Technical Support Group
Bang:    decwrl!burfle.enet!murphy	This posting expresses MY opinions only;
Ding:    301-306-2040.			 I do not speak for Digital.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is cc broken on OSF/1 and ULTRIX?
  1994-10-12 17:46 ` Rick Murphy
@ 1994-10-12 22:35   ` Dan Pop
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Pop @ 1994-10-12 22:35 UTC (permalink / raw)


In <37h7di$p9b@decuac.dec.com> murphy@dco.dec.com (Rick Murphy) writes:

>In article <CxKC80.5xr@news.cern.ch> danpop@cernapo.cern.ch (Dan Pop) writes:
>>c89 does the right thing, but cc doesn't. C++ style comments are not
>>supported by either K&R or ANSI C and this feature (I'd call it bug)
>>is not documented in the man page.
>
>See the c preprocessor manpage -
>
>  The cpp preprocessor accepts C++-style end of line comments (//).  This
>  means that everything following the two slashes (//) to the end of the line
>  in which they appear is considered as a comment.
>
>>cc on AIX, Solaris, SunOS, IRIX, HPUX and Domain/OS behaves correctly.
>>Will DEC fix its cc?
>See above. Using   cc -std1 works `correctly' as well.

I would like to get the correct behaviour as default and C++ comments
enabled as a result of a compiler option. Is there any reason to get
the broken behaviour as default, especially since nobody else (except,
probably, Turbo C for MSDOS) is doing this?

Historically, cc without any options invokes a K&R C compiler (with
various ANSI extensions, these days). I've never seen before a cc with
C++ extensions by default and I don't think this is a very good idea,
especially since it breaks valid K&R C code.

Dan
--
Dan Pop 
CERN, CN Division
Email: danpop@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is cc broken on OSF/1 and ULTRIX?
  1994-10-12 15:39 ` Ron Natalie
@ 1994-10-13 15:29   ` Wayne Scott
  0 siblings, 0 replies; 5+ messages in thread
From: Wayne Scott @ 1994-10-13 15:29 UTC (permalink / raw)



In article <37h004$uql@topaz.sensor.com>, ron@topaz.sensor.com (Ron Natalie) writes:
|>Dan Pop (danpop@cernapo.cern.ch) wrote:
|>: c89 does the right thing, but cc doesn't. C++ style comments are not
|>: supported by either K&R or ANSI C and this feature (I'd call it bug)
|>: is not documented in the man page.
|>
|>If you want standard behavior out of the DEC compiler, it behooves you
|>to turn on the -std1 flag.
|>
|>-Ron
|>


Be wary about using the "-std" option alone.
It sounds nice...the man page says:

"and -std enforces the ANSI C standard with popular extensions."

But I experienced very stange X/Motif behavior until
I switched to the "-std1" option.  Unfortunately, I could no longer
use "//" for comments.  I programmed the @ and # keys in vi so that
I could easily surround those lines with "/*" and "*/".  Bummer.

Wayne
-- 
----------------------------------------------
	wws@cc.bellcore.com
I'm just a soul whose intentions are good,
Oh Lord, please don't let me be misunderstood.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1994-10-13 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-10-12 14:00 Is cc broken on OSF/1 and ULTRIX? Dan Pop
1994-10-12 15:39 ` Ron Natalie
1994-10-13 15:29   ` Wayne Scott
1994-10-12 17:46 ` Rick Murphy
1994-10-12 22:35   ` Dan Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox