Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 31 Aug 2012 12:27:53 -0700
From: Isaac Dunham <idunham@...abit.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH/RFC] inline cleanup/C89 support

On Fri, 31 Aug 2012 10:34:18 +0200
Szabolcs Nagy <nsz@...t70.net> wrote:

> * Isaac Dunham <idunham@...abit.com> [2012-08-30 15:45:34 -0700]:
> > On Fri, 24 Aug 2012 09:53:16 +0200
> > Szabolcs Nagy <nsz@...t70.net> wrote:
> > > this won't work with c++, nor old strict c compilers
> > > without __inline and __restrict and can break various
> > > c parsing tools (ctags, swig, various lints, ..)
> > 
> > 1. Do any of these "old strict c compilers" exist on Linux?
> 
> yes
> (eg sdcc for microcontrollers, plan9 cc used for the go runtime)
 
sdcc is not relevant: it doesn't link against the system libc, so it
shouldn't use system headers.
I thought I heard plan9 cc used its own libc?
 
> > 2. Have you tested those C parsing tools? Have they been updated to
> > support C99?
> > 
> i used some of them, i know ctags handles __restrict
> while swig (1.3) does not
> 
> many of the c (and c++) parsing tools dont do correct
> preprocessing or don't define all the macros like
> __STDC_VERSION__ so even if c99 grammar is mostly
> supported i wouldnt be surprised if doxygen or indent
> or similar tools had problems with __restrict

Ah.

> > If it is a realistic combination (can produce a working hello
> > world), then it *might* be worth supporting.
> 
> the headers are not only for compiling musl

But they are only for compiling *against* musl (ie, if it uses its own
libc or cannot produce working binaries linked against musl, it
shouldn't be using musl headers). 

> of course glibc uses __restrict so it should work
> most of the time

In case you didn't notice, this patch addresses uses __inline if
pre-c99 C is used, and __restrict is not involved. __restrict is
something that does need to be considered, however.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.