Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
To: David Laight <david@l8s.co.uk>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 07/18/2003 12:31:48
[ On Thursday, July 17, 2003 at 21:34:07 (+0100), David Laight wrote: ]
> Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
>
> Just be glad you aren't using the old IBM (IIRC) system which had the
> constants 0, 1, 2 at 'well known' addresses.

Well I did have the eye-opening experience early in my professional
career to use a C compiler on a Commodore 64.  This was right after
having used PCC on PDP-11s and VAX-11s at university.  At the time I was
very familiar with 6502 machine language programming, as well as the
hardware architecture of the C64, but still some of the things that
compiler did with page zero were, well, strange.  :-)

This was my first experience with C in what's effectively and "embedded"
systems environment, and it soured me on such environments for a very
long time (though it took me nearly four more years to get completely
away from working with such environments again -- which didn't help me
appreciate embedded systems development either of course).

> IIRC --writable-strings causes gcc to put strings in the .data instead
> of .rodata.

Yes, it does.

>  I'm not at all sure it even changes the (impiled) type
> of the string itself.

Yes it does do that as well, at least that's what seems to happen given
an experiment with a test that would otherwise produce a "warning:
assignment discards `const' from pointer target type" message.

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>