This is the mail archive of the gcc-patches@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: [C] Fix PR57258: unused variable warning is emitted for volatile variables


On Nov 7, 2013, at 5:13 PM, Mingjie Xing <mingjie.xing@gmail.com> wrote:
> Well, it is my understanding that the warning should be emitted for a
> volatile variable only if it is not accessed.  Initialization means
> accessing, even though it is not used anywhere.

Let me try.  A warning is useful, if there is no way a conforming program can tell that the variable exists or not.  So, the question is, how can you notice the variable?  Answer, there is no way, so, there is no utility in having the variable.  The warning is to tell the user to remove the dead variable.

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