This is the mail archive of the gcc@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: Uninitialized integers and warnings


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


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