Date: Mon, 24 Aug 1998 22:11:31 +0200 From: Martin Cracauer <cracauer@cons.org> To: Gary Palmer <gpalmer@FreeBSD.ORG>, Martin Cracauer <cracauer@FreeBSD.ORG> Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/bin/sh arith.y arith_lex.l error.c error.h jobs.c jobs.h miscbltin.c trap.c trap.h Message-ID: <19980824221131.A4135@cons.org> In-Reply-To: <19980824212429.A3758@cons.org>; from Martin Cracauer on Mon, Aug 24, 1998 at 09:24:29PM %2B0200 References: <199808241020.DAA21352@freefall.freebsd.org> <21305.903974922@gjp.erols.com> <19980824212429.A3758@cons.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I wrote:
> And a variable is allowed to be declared volatile in one source file
> and not volatile in another, hence it is not a conflict to have an
> extern declaration without it and then a definition with volatile
> within the same scope.
Ops, here my own assumptions ruled over the facts.
ANSI says:
6.5: "All declarations in the same scope that refer to the same object
or function shall specify compatible types"
6.5.3 "For two qualified types to be compatible, both shall have
the identically qualified version of a compatible type: ..."
The following code is illegal, although it passes FreeBSD' gcc at
-Wall. Still my question, what compiler did you use?
> This program compiles fine with -Wall under FreeBSD's default gcc:
>
> #include <signal.h>
> extern volatile sig_atomic_t bla;
> int bla;
> int main(void)
> {
> exit(0);
> }
Martin
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer
Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536
Paper: (private) Waldstrasse 200, 22846 Norderstedt, Germany
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980824221131.A4135>
