NetBSD-Bugs archive

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

Re: misc/41255: gcc 4.3.3 won't compile some of the source tree



The following reply was made to PR misc/41255; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: misc/41255: gcc 4.3.3 won't compile some of the source tree
Date: Mon, 27 Apr 2009 23:41:41 +0200

 On Tue, 21 Apr 2009, Kurt J. Lidl wrote:
 >  --- usr.bin/mail/lex.c      17 Dec 2007 22:06:00 -0000      1.36
 >  +++ usr.bin/mail/lex.c      21 Apr 2009 01:49:21 -0000
 >  @@ -484,7 +484,7 @@
 >   {
 >      char *word;
 >      char *arglist[MAXARGC];
 >  -   const struct cmd *com = NULL;
 >  +   const volatile struct cmd *com = NULL;
 >      char *volatile cp;
 >      int c;
 >      int e = 1;
 
 I think that should be
        const struct cmd * volatile com = NULL;
 (a volatile pointer to a non-volatile const struct).
 
 By my reading of the setjmp/longjmp rules in section 7.13.2.1 of the
 N1256 draft of the C99 standard), com needs to be volatile to protect it
 from becoming indeterminate as a result of a longjmp call.  The struct
 that com points to, on the other hand, does not have automatic storage
 duration and is therefore not at risk of becoming indeterminate, whether
 or not it is volatile.
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index