Source-Changes-D archive

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

Re: CVS commit: src/sys/sys



On Mon, Mar 21, 2016 at 02:34:25PM +0000, David Holland wrote:
> On Mon, Mar 21, 2016 at 01:36:22AM +0100, Joerg Sonnenberger wrote:
>  > Here is a trivial test case showing that the basic problem exists for
>  > both clang and gcc:
>  > 
>  >    int a, b
>  > 
>  >    int f(void) {
>  >      return &a != &b;
>  >    }
> 
> Do you perhaps mean "extern int a, b;"? That's an important
> distinction. In particular I can't find anything in C99 that
> guarantees that two such declarations for which storage is not
> reserved can't refer to the same object.

The historic mistake of using common for uninitialised storage is
irrelevant and so is using extern or not. In C11, the relevant case is
6.5.9 (6).

Joerg


Home | Main Index | Thread Index | Old Index