Topic: Incompatibilities Between C++ and C??


Author: alanc@mistral.co.uk (Alan Campbell)
Date: 1995/05/24
Raw View
I ran into a company selling a static C++ code analyser which claimed
there were 40+ incompatibilities between ANSI C++ and ANSI C syntax.

I can only find much smaller lists of incompatibilities,
and said company ain't gonna cough up a list of them.

Anyone know where I can find more about??

Thanks

Alan Campbell





Author: jbuck@synopsys.com (Joe Buck)
Date: 1995/05/24
Raw View
alanc@mistral.co.uk (Alan Campbell) writes:
>I ran into a company selling a static C++ code analyser which claimed
>there were 40+ incompatibilities between ANSI C++ and ANSI C syntax.

I take it you mean constructs that are valid ANSI C programs and have
a different meaning or are illegal in C++.

For a list from the Working Paper, see Annex C (if you have a web
browser, http://www.cygnus.com/~mrs/wp-draft/diff.html -- thanks to
Cygnus for putting this up).

If you count each new C++ keyword separately, you should get way past 40:
each one breaks C programs that use them as identifiers.  But most of
the changes you're unlikely to hit, unless you write things like

 a = b //* */ c
 ;
--
-- Joe Buck  <jbuck@synopsys.com> (not speaking for Synopsys, Inc)
Phone: +1 415 694 1729