Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 33587: /trunk/ /trunk/epan/dissector

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Tue, 20 Jul 2010 14:58:58 +0200
On Tue, Jul 20, 2010 at 02:47:13AM -0700, Guy Harris wrote:
> On Jul 20, 2010, at 1:27 AM, jmayer@xxxxxxxxxxxxx wrote:
> 
> > http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=33587
> > 
> > User: jmayer
> > Date: 2010/07/20 01:27 AM
> > 
> > Log:
> > Updading opensuse 11.2 -> 11.3 updated gcc to 4.5.0, which created
> > a few warnings that needed fixing when compiling with -Werror.
> 
> Is this a bug in GCC 4.5.0, or did I miss something in my reading of the ANSI C standard?  Shouldn't declaring the variables in question as "volatile" be sufficient to keep the compiler from whining about them being trashed by longjmp?

I do not have enough knowledge about C to answer that.

I've just recreated the problem to paste the warning (turned error) for
the first instance, where the code was commented out before my patch:

cc1: warnings being treated as errors
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-mac-lte.c: In function ‘dissect_bch.clone.2’:
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-mac-lte.c:1355:28: error: variable ‘protocol_handle’ might be clobbered by ‘longjmp’ or ‘vfork’
make[1]: *** [epan/CMakeFiles/epan.dir/dissectors/packet-mac-lte.c.o] Error 1
make[1]: Leaving directory `/home/jmayer/work/wireshark/svn/build'
make: *** [dissectors/packet-mac-lte.c.o] Error 2
make: Leaving directory `/home/jmayer/work/wireshark/svn/build/epan'

and that's the code starting on line 1366:
#if 1
    TRY {
        call_dissector_only(protocol_handle, rrc_tvb, pinfo, tree);
    }
    CATCH_ALL {
    }
    ENDTRY
#else
        call_with_catch_all(protocol_handle, rrc_tvb, pinfo, tree);
#endif

It obviously worked in the past, but with the release of a first(?)
gcc 4.5.0 distro I thought that getting WS to compile was a priority.

Ciao
    Joerg

-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.