[Top][All Lists]

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

Re: [Tinycc-devel] c89

From: Vincent Lefevre
Subject: Re: [Tinycc-devel] c89
Date: Wed, 27 Sep 2017 09:29:53 +0200
User-agent: Mutt/1.9.1-7166-vl-r99863 (2017-09-23)

On 2017-09-26 20:14:25 -0700, Larry Doolittle wrote:
> Friends -
> On Tue, Sep 26, 2017 at 03:49:09PM -0700, Larry Doolittle wrote:
> > Someone asked about c89.  I made a simple experiment on mob.
> > 1.  Replace 67 //-style comments with /* */
> > 2.  #define inline __inline__ in tcc.h
> > 3.  Use --std=c89 under gcc-4.9.2 on x86_64
> > The result builds and passes self-tests.
> I went through the tcc compile with --std=c89 -pedantic and
> --std=c99 -pedantic options.

Note that --std=c89 -pedantic(-errors) is not sufficient to detect all
use of non-C89 features (only those that require a diagnostic). In
particular, using <stdint.h> remains undetected by --std=c89 -pedantic
with the current GCC. And even in C99, the types int64_t and uint64_t
are optional (in case they are also used for bootstrapping).

BTW, in practice, compiler bugs may be more an issue than the
possible use of a C89 compiler.

So, about the use of old (and new) compilers, perhaps it could be
better to report issues when they are found.

You might want to try CompCert[*], which supports only a subset of C
(a very large subset of C89 + some C99 features, AFAIK).

[*] http://compcert.inria.fr/

Vincent Lefèvre <address@hidden> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]