Re: Cast abuse



On Mon, 19 November 16:08 Toralf Lund wrote:

> Can the str...() declarations be assumed to use "const" properly on all 
> platforms? I seem to remember that _all_ string arguments had type "char *" 
> on some of our systems in a not-to-distant past.

That was certainly the case during the transition from K&R to ANSI in a Unix 
environment (SCO used to be painful in this regard).

However, having a quick look at the SIngle Unix Spec, all the const 
declarations are in the expected places.  As I understand it, to be allowed to 
call a system Unix requires conforming to SUS or SVID, or whatever the current 
flavour of the month standard is.

I conclude from this there will be no problems on any modern Unix, besides if 
its too ancient to have const properly implemented in the headers, it's 
unlikely to have compiled Gnome either.  And we know GNU CC/libc is correct in 
this respect.  As a last resort you can always say

CPPFLAGS=-Dconst="" ./configure ....

Brian




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]