This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Uninitialized integers and warnings
- From: Ian Lance Taylor <iant at google dot com>
- To: Kirill Tkhai <tkhai at yandex dot ru>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 4 Sep 2013 07:06:12 -0700
- Subject: Re: Uninitialized integers and warnings
- Authentication-results: sourceware.org; auth=none
- References: <154831378302042 at web21m dot yandex dot ru>
On Wed, Sep 4, 2013 at 6:40 AM, Kirill Tkhai <tkhai@yandex.ru> wrote:
>
> the following example compiles without warnings:
>
> $ cat a.c
> int func (int p)
> {
> int x;
> if (p != 0)
> x = 1;
> return x;
> }
>
> $ gcc -c a.c -Wall
> (no messages)
>
> Is there no error? Why compiler doesn't print a error
> about uninitialized variable?
>
> I saw many pieces like this in GNU software. Does
> it mean that it is a de-facto standard and gcc won't warn
> about code like this in the future?
This question would be more appropriate on the mailing list
gcc-help@gcc.gnu.org. The mailing list gcc@gcc.gnu.org is for
discussions about the development of GCC itself. Please take any
followups to gcc-help. Thanks.
That said, I think this case is a bug. Please report it following the
instructions at http://gcc.gnu.org/bugs. Thanks.
Ian