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

Re: portability as a goal for debian?



On Wed, Mar 07, 2001 at 03:14:49PM -0700, Eric Schwartz wrote:
> No, but I don't think it's unreasonable to require (or at least
> encourage) every software author to write to standards (ANSI for C/C++;
> JLS for Java, etc.).  If given a choice between writing code that'll only 
> compile on gcc or code that'll compile on any ANSI standard compiler,
> I'll go with the ANSI-compliant code, if for no other reason than more
> people are likely to be conversant with ANSI standards than gcc's
> proprietary extensions.

Ah, but I do think it is unreasonable to require this, because often
the standards guarantee very little functionality.  For example, ANSI
C allows a compiler to look only at the first six characters when
deciding whether identifiers are equal or not.  So you can't have two
functions named "list_create()" and "list_create_empty()", for example.

In fact, ANSI C requires so little from a compiler that it's possible
for /bin/false to qualify, if someone writes the right documentation
for it :-)  (I might perform this exercise on some April 1st.)

I doubt there is much code in the world that would really compile
on any ANSI standard compiler, or work in any ANSI C hosted environment.

> Fortunately, gcc has -pedantic and -ansi, so it's not like we have to use 
> different toolsets.

gcc -ansi -pedantic doesn't warn about all non-standard constructs,
but only about the ones for which ANSI C requires a diagnostic.

Richard Braakman



Reply to: