This is the mail archive of the gcc-bugs@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]

[Bug c++/70253] New: gets() c++14


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

            Bug ID: 70253
           Summary: gets() c++14
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lonewohlf42 at cogeco dot ca
  Target Milestone: ---

when legacy code

#include <stdio.h>

int main()
{
    char s1[10];

    gets(s1);
    ...
}

is compiled using C++14 compiler switch on Linux Ubuntu 15.10 using
Code::blocks
IDE 16.01.

The compiler gives error Stating:

error: gets was not declared in this scope.

if compiled using C++98 or C++11 compiler switch, code  works fine.

I know function gets() is deprecated.

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