This is the mail archive of the
mailing list for the GCC project.
Re: [C] Fix PR57258: unused variable warning is emitted for volatile variables
- From: Mike Stump <mikestump at comcast dot net>
- To: Mingjie Xing <mingjie dot xing at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "Bin.Cheng" <amker dot cheng at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Nov 2013 03:01:47 -0800
- Subject: Re: [C] Fix PR57258: unused variable warning is emitted for volatile variables
- Authentication-results: sourceware.org; auth=none
- References: <CADNgcEwhF9u2S=f3GdLtWo98BBQs-BVdzRh7-mspQHBAHhUYaw at mail dot gmail dot com> <CAFiYyc1OtvdCoawpsSStPF=qZJN+DHJUy_Hn=6a=9Tmk0uPp6g at mail dot gmail dot com> <CADNgcEzv0gdtADDwE1V4yn1ruwVE32eOocXk_HmLtcPhDiWu3w at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1311071335560 dot 17103 at digraph dot polyomino dot org dot uk> <CADNgcEw_xtipAL-iEyNZj5UO5=+RwjoE584aLRGp3oouqF_xAw at mail dot gmail dot com> <BC5C730B-0DBF-4E42-9ADD-995372336C40 at comcast dot net> <CAHFci2_FUcQuWXmNbBPp4X_tx4nUi4o9gq+1bn_2-_W2n6PUJA at mail dot gmail dot com> <884F2353-507A-4F01-95D2-ECDDE7BA0B7A at comcast dot net> <CAFiYyc0ajkcMVFk1hZ5_HDK_S5DVTut_dDxs8dkcdaZ69D-qDA at mail dot gmail dot com> <CADNgcEz8Oo8B7xhGORFF7vpuNj0VKuqkVK3dRPK03PTH=4H7Zw at mail dot gmail dot com>
On Nov 8, 2013, at 2:35 AM, Mingjie Xing <firstname.lastname@example.org> wrote:
> Oops, if it is not a bug, please close the report
Well, I've stated my position. I can be swayed by a good argument, if someone has one. I'd give people a chance to weigh in if they can think of one. A global variable with linkage is completely different, as the linker can grab it, dlsym can grab it, and who knows… while a cleaver (Ian type of cleaver) person could grab an automatic variable, the difficulty is enormous and doing that would be exceedingly odd. I don't know of any coding style where people do that sort of thing. Reflection comes the closest; dynamic bindings (a la lisp) I guess comes second; shudder. I'd make them mark it with the used attribute, since they're really weird.