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: PING [PATCH] Fix 32-bit bootstrap on PowerPC


On Thu, Nov 11, 2010 at 10:59 PM, Pat Haugen
<pthaugen@linux.vnet.ibm.com> wrote:
> On 11/9/2010 5:27 PM, Pat Haugen wrote:
>>
>> Is the following an obvious patch? It fixes the recent error I see during
>> 32-bit bootstrap (not sure why I don't see the same for 64-bit).
>>
>>
>> /home/pthaugen/src/gcc/trunk/gcc/gcc/opts-common.c: In function
>> #decode_cmdline_options_to_array#:
>> /home/pthaugen/src/gcc/trunk/gcc/gcc/opts-common.c:543:4: error:
>> #separate_args# may be used uninitialized in this function
>> [-Werror=uninitialized]
>> /home/pthaugen/src/gcc/trunk/gcc/gcc/opts-common.c:290:43: note:
>> #separate_args# was declared here
>> cc1: all warnings being treated as errors

Hmm, it looks like it can be used uninitialized but 0 looks like a
valid default value.

Thus, the patch is ok.

Thanks,
Richard.

>>
>>
>> -Pat
>>
>>
>> 2010-11-09 ?Pat Haugen <pthaugen@us.ibm.com>
>>
>> ? ?* opts-common.c (decode_cmdline_option): Initialize separate_args.
>>
>>
>> Index: opts-common.c
>> ===================================================================
>> --- opts-common.c ? ? ? (revision 166498)
>> +++ opts-common.c ? ? ? (working copy)
>> @@ -287,7 +287,7 @@ decode_cmdline_option (const char **argv
>> ? size_t opt_index;
>> ? const char *arg = 0;
>> ? int value = 1;
>> - ?unsigned int result = 1, i, extra_args, separate_args;
>> + ?unsigned int result = 1, i, extra_args, separate_args = 0;
>> ? int adjust_len = 0;
>> ? size_t total_len;
>> ? char *p;
>>
>
>
>


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