[Bug c++/69925] New: No warning for uninitialized char * passing to function as const char *

development@faf-ltd.com gcc-bugzilla@gcc.gnu.org
Tue Feb 23 17:00:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69925

            Bug ID: 69925
           Summary: No warning for uninitialized char * passing to
                    function as const char *
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: development@faf-ltd.com
  Target Milestone: ---

auto foo( const char * ) -> void;

int main()
{
        char bar [100];

        foo( bar );
}

In my opinion gcc should warn that bar is uninitialized used due to the fact it
is used as const in foo().

g++ -Wall -Wextra -Werror -c foo.cpp

I have to admit that I could not find any compiler which warns about this:
https://goo.gl/0d6KU4


More information about the Gcc-bugs mailing list