This is the mail archive of the 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: [Consult] g++: About "-Wunused-variable" for constant variable initialized by function

On 10/15/14 18:07, Chen Gang wrote:
> On 10/13/14 21:18, Chen Gang wrote:
>> On 10/13/14 18:53, Jason Merrill wrote:
>>> On 10/12/2014 10:32 AM, Chen Gang wrote:
>>>>    [root@localhost qemu_cc]# cat
>>>>    const char n() { return 1; }
>>>>    const char c =  n();
>>>>    [root@localhost qemu_cc]# /usr/local/bin/g++ -Wall -O0 -c -o test.o
>>>>    [root@localhost qemu_cc]# /usr/local/bin/g++ -Wall -O2 -c -o test.o
>>>> warning: 'c' defined but not used [-Wunused-variable]
>>>>     const char c =  n();
>>>>                ^
>>> The warning is correct (and new).  Please submit bug reports via the website; see

Aftr trying, I can not make a new account for gcc bugzilla.

 - Before file a bug, it is mandatory to have an acount.

 - I try to register a new account on the website, it said that need
   send mail to

 - I sent related mail to, but get no response.

Need I wait for some days? or could any member help to file this bug to
gcc bugzilla?

And whether it is OK or not, I shall try to analyze this issue directly,
I should try to finish it within 2014-10-31 (although I am really not
quite sure about it).


> Thank Jason Merrill, again. At present, I have got enough confirmation
> from you and other members (excuse me, I am not quite familiar with C++,
> for me, it is a complex language, so need several members confirmation).
> And if no additional reply within this week, I shall submit bug reports,
> and try to fix it within this month (although I am really not quite
> sure).
> I am not quite familiar with C++, so if any members worry about me: feel
> that I am not quite suitable to report bug and fix it, please let me
> know within this week.
> Thanks.
>> OK, thanks. After finish this consult, I shall report bugs, and shall
>> try to fix it (I got it from Qemu which in my current focus border).
>> Hope I can finish within this month.
>> And one another consult: if the constant variable is defined in header
>> file, and never be used, need our g++ still report warning about
>> [-Wunused-variable] too (for me, I guess, not)?
>> Thanks.

Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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