gcc-2.7.2.1

Stefan Bellon sbellon at sbellon.de
Wed Jan 21 18:00:01 CET 2004


Matthias Andree wrote:
> On Wed, 21 Jan 2004, Stefan Bellon wrote:

> > Does this piece of code compile in GCC's strict C90 or C99 mode?
> > 
> >         void f(char c, signed char sc, unsigned char uc)
> >         {
> >           char* pc = &uc;
> >           signed char* psc = pc;
> >           unsigned char* puc = pc;
> >           psc = puc;
> >         }

> Steenkin' munchin' types!

Those are the most annoying ones when porting GNU projects to RISC OS
as Norcroft C very closely sticks to the C standard and indeed outputs
four errors in the above example.

> It does, with a bag of warnings.

The C standard says to output a diagnosis. This should be an error and
no warning. In C++, Stroustrup explicitly states that all four
assignments above must produce an error.

-- 
Stefan Bellon




More information about the Bogofilter mailing list