On 11/23/19 6:35 PM, Simon Slavin wrote:
> On 23 Nov 2019, at 11:06pm, Richard Hipp <d...@sqlite.org> wrote:
>
>> given the choice between
>>
>> (1) Code that works and does something useful
>> (2) Code that is standards compliant
>>
>> I'll always go with (1).
> Another problem is that different compilers, or the same compiler with 
> different options, warn about different things.  And that making changes to 
> make one compiler happy can make another compiler unhappy.  Until you end up 
> with
>
>     complicated line here;    /* actually does a = b but
>                               must keep four compilers happy */

I consider it an error in specifications if there is a requirement for
no warnings without specifying what compiler/options that requirement
needs to be meet on. It can be shown to be impossible to get totally
warning free code on arbitrary compilers.

As to the original question, if the program uses the type long long,
then it can't be C89/C90 compatible, as the type didn't exist then. It
might be that the program given some option could make a variation that
doesn't use long long for very old systems.

As to the conversion between function pointers and data pointers, this
ability is not specified in the C Standard, and on some machines it
actually can't be done. POSIX compatibility requires that it works in at
least some limited situation as an extension. (Originally, there was
some confusion over if it required a diagnostic in fully conforming mode
or not, of course enabling POSIX would suppress that message).

Sometimes code is just easier to write (or performs better) if you use
extensions provided by an implementation. Doing so limits what compilers
can be used, but some GCC extensions are just so commonly available on a
variety of platforms that the limitation is minor.

-- 
Richard Damon

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to