This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: try/finally in GNU C


Steven Bosscher wrote:
On 6/16/06, Mike Stump <mrs@apple.com> wrote:
> foo() {
>    int i = 99;
>    __builtin_setjmp(A)
>    if (i) {
>      print i
>      --i;
>      __builtin_longjump(A);
>    }
>
> It used to not infinite loop, now it does.

We had an example just like this on IRC only a few weeks ago. ISTR it
was decided that this triggers undefined behavior by C99 7.13.2.1 sub
3.

I think that every variable you do "weird" things with in C, must be declared volatile.


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]