mohitnegi Posted June 15, 2016 Report Share Posted June 15, 2016 hi , I have updated my gcc compiler to 4.9 version . now when I compile my system C model with g++14 compiler option enabled ,it is giving this error in systemC header file systemc.h 118:16 error std::gets is not declared using std::gets I was not getting this error earlier . I tried building my systemC library with ./configure CXX=g++-4.9 but the same issue comes up .. can anyone help in this ?? Quote Link to comment Share on other sites More sharing options...
Stephan Gerth Posted June 15, 2016 Report Share Posted June 15, 2016 std::fgets was deprecated AFAIR. You can comment this line actually at the moment. An official fix will be probably available with the next release. Quote Link to comment Share on other sites More sharing options...
apfitch Posted June 15, 2016 Report Share Posted June 15, 2016 Hi Stephan, I believe std::gets was deprecated in c++11, removed in c++14. But std::fgets is still valid. regards Alan Quote Link to comment Share on other sites More sharing options...
Stephan Gerth Posted June 15, 2016 Report Share Posted June 15, 2016 You're right, typo on my side. Quote Link to comment Share on other sites More sharing options...
mohitnegi Posted June 16, 2016 Author Report Share Posted June 16, 2016 hi Stephan/Alan, so guys any work around for using c++14 with systemC without " error std::gets is not declared using std::gets" . Thanks Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted June 16, 2016 Report Share Posted June 16, 2016 Yes, you can fix SystemC source code. Just comment it out in SystemC header. Quote Link to comment Share on other sites More sharing options...
daveW Posted March 1, 2017 Report Share Posted March 1, 2017 FYI, I had errors when running "gmake check" as part of my build/install of systemc-2.3.1a. I modified './src/systemc.h' line 120 from "using std::gets" to "using std::fgets". The "gmake check" did complete execution after I made this change. Although other warnings were thrown. I am using gcc 4.8.5 that has g++ version 6.2.1 20160826 (openSUSE Leap 42.2 x86_64). Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted March 1, 2017 Report Share Posted March 1, 2017 @daveW you can tryout the SystemC 2.3.2 draft release which fixes most of the issues while building under C++11/C++14 compilers. Have a look here: Regards, Ameya Vikram Singh Philipp A Hartmann and maehne 2 Quote Link to comment Share on other sites More sharing options...
benamar Posted November 22, 2019 Report Share Posted November 22, 2019 On 6/16/2016 at 5:51 PM, Roman Popov said: Yes, you can fix SystemC source code. Just comment it out in SystemC header.t thank you very much, i have the same problem ,it was solved Quote Link to comment Share on other sites More sharing options...
benamar Posted November 22, 2019 Report Share Posted November 22, 2019 On 6/16/2016 at 5:51 PM, Roman Popov said: Yes, you can fix SystemC source code. Just comment it out in SystemC header.t thank you very much, i have the same problem ,it was solved Quote Link to comment Share on other sites More sharing options...
David Black Posted November 22, 2019 Report Share Posted November 22, 2019 Observation: gets() is now considered forbidden in C since it is the cause of many hack attacks to create buffer overflow. get_s is recommended because it puts an upper limit on the number of acceptable characters. Although C++ std::string can handle large strings, it could still be an issue. I am not saying you should never use it, but please be aware. I realize our SystemC activities are usually confined to safe internal use only situations, but I can forsee examples on the open web that might lead to an issue. [Note: I teach C/C++ security courses in addition to my SystemC activities..] Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted November 23, 2019 Report Share Posted November 23, 2019 On 3/1/2017 at 6:19 PM, AmeyaVS said: @daveW you can tryout the SystemC 2.3.2 draft release which fixes most of the issues while building under C++11/C++14 compilers. Even better: Use the latest stable SystemC 2.3.3, which fixes several issues in 2.3.2. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.