libc warnings/fix

View: New views
5 Messages — Rating Filter:   Alert me  

libc warnings/fix

by Alexander Shishkin-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have one more patch [1] to fix three "may be used uninitialized in this
function" warnings emitted by newer gcc. All three are unlikely to cause
any problems [obviously], but are perfectly valid from compiler's
standpoint.

[1]: http://koowaldah.org/people/ash/netbsd/fix-libc-warnings.patch

Regards,
--
Alex

Re: libc warnings/fix

by Christos Zoulas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In article <20080724074745.GI22423@...>,
Alexander Shishkin  <alexander.shishkin@...> wrote:
>Hi,
>
>I have one more patch [1] to fix three "may be used uninitialized in this
>function" warnings emitted by newer gcc. All three are unlikely to cause
>any problems [obviously], but are perfectly valid from compiler's
>standpoint.
>
>[1]: http://koowaldah.org/people/ash/netbsd/fix-libc-warnings.patch
>

Why? The first two seem like compiler regressions and the compiler should
be able to figure out. The third is more difficult for the compiler to figure
out, so it is acceptable.

christos


Re: libc warnings/fix

by David Laight :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 24, 2008 at 08:24:47PM +0000, Christos Zoulas wrote:

> In article <20080724074745.GI22423@...>,
> Alexander Shishkin  <alexander.shishkin@...> wrote:
> >Hi,
> >
> >I have one more patch [1] to fix three "may be used uninitialized in this
> >function" warnings emitted by newer gcc. All three are unlikely to cause
> >any problems [obviously], but are perfectly valid from compiler's
> >standpoint.
> >
> >[1]: http://koowaldah.org/people/ash/netbsd/fix-libc-warnings.patch

Save us by inlining patches that are that short...

> Why? The first two seem like compiler regressions and the compiler should
> be able to figure out. The third is more difficult for the compiler to figure
> out, so it is acceptable.

I guess the first is because the compiler has detected that 'get_shared'
doesn't set '*rci' in all paths.

Similarly for '*variable' in lookup_mapper_entry.

        David

--
David Laight: david@...

Re: libc warnings/fix

by Andy Shevchenko-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 24, 2008 at 11:41 PM, David Laight <david@...> wrote:
>> >[1]: http://koowaldah.org/people/ash/netbsd/fix-libc-warnings.patch
> Save us by inlining patches that are that short...
I don't understand your optimism.

1.
  some_type *ci;
  ...
  ret = get_shared(&ci, ...);

How could you guess about usage of the **ci?
Indeed get_shared() doesn't care about contains of **rci in some branches.

2. The same behaviour for lookup_mapper_entry() and **variable.
3. Probably compilator regression is occur.

I think the gcc is right in 1. and 2. predictions.

--
With Best Regards,
Andy Shevchenko

Re: libc warnings/fix

by Christos Zoulas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 25, 12:31pm, andy.shevchenko@... ("Andy Shevchenko") wrote:
-- Subject: Re: libc warnings/fix

| On Thu, Jul 24, 2008 at 11:41 PM, David Laight <david@...> wrote:
| >> >[1]: http://koowaldah.org/people/ash/netbsd/fix-libc-warnings.patch
| > Save us by inlining patches that are that short...
| I don't understand your optimism.
|
| 1.
|   some_type *ci;
|   ...
|   ret = get_shared(&ci, ...);
|
| How could you guess about usage of the **ci?
| Indeed get_shared() doesn't care about contains of **rci in some branches.

Then it returns non zero, and the calling code does not use rci.

| 2. The same behaviour for lookup_mapper_entry() and **variable.

Again same I guess.

| 3. Probably compilator regression is occur.
|
| I think the gcc is right in 1. and 2. predictions.

I will apply the patches.

christos