Re: Can anyone help : ERROR 296

From: Dennis Handly (dhandly_at_convex.hp.com)
Date: 09/23/05


Date: 22 Sep 2005 22:20:31 -0600

In article <1127376984.885301.315410@z14g2000cwz.googlegroups.com> you wrote:
: Error 298: "test.c", line 6 # In ANSI C bitfields must be one of 'int',
: 'signed int', or 'unsigned int' type.
: u_char field1 :4;

What compiler version (-V) are you using?
I can't get that error unless +We298 is used.

Only obsolete A.03.30 and A.03.31 will give that error by default.
And the Release Notes for aC++ A.03.30 state:
o Early Support for ANSI C compiler
Not all features are enabled in this release. The following is a
list of current limitations. Some code that is a warning in C is
a fatal error in aC++.
(Unfortunately Error 298 wasn't listed.)

In other words, if you are on PA, you should be using cc for the ANSI C
compiler, not aCC -Ae.
On IPF, it doesn't much matter since they are the same.



Relevant Pages

  • Re: Strange behaviour, bug in Borland compiler?
    ... > OK, so if you understand it as an unsigned integer constant, ... In fact the signed int is converted to unsigned and then they ... There are some things in C where the result depends on the compiler ... The Borland compiler doesn't give you the warning -- ...
    (comp.lang.cpp)
  • Re: va_arg and short
    ... >I changed it to int and it compiled just fine. ... the compiler is obligated to ... have to go with one that says that if plain char is unsigned, ... widens to signed int anyway, ...
    (comp.lang.c)
  • Re: Datatypes
    ... but in some compiler we have to write explicitly "signed int ", ... real code and actual error messages? ... Keith Thompson kst-u@xxxxxxx ...
    (comp.lang.c)
  • Re: >> to accelerate division
    ... David Kastrup wrote: ... >> shift. ... your compiler may already be doing it for you. ... Not if i is a signed int, it won't - at least, it's not guaranteed to. ...
    (comp.programming)
  • Re: >> to accelerate division
    ... David Kastrup wrote: ... >> shift. ... your compiler may already be doing it for you. ... Not if i is a signed int, it won't - at least, it's not guaranteed to. ...
    (sci.math)