stzog Posted February 11, 2015 Report Share Posted February 11, 2015 Hi to all!I am trying to build a packet switch for a project i am assigned and i have the following errorS 1> switch_clk.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1> switch.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1> sender.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1> receiver.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1> main.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1> fifo.cpp 1>c:\systemc-2.3.1\systemc-2.3.1\src\sysc\datatypes\int\sc_nbutils.h(149): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h(356) : see declaration of 'sprintf' 1>c:\users\zogas\desktop\new folder\packet_switch_final\packet_switch_final\fifo.cpp(7): warning C4244: 'argument' : conversion from 'sc_dt::uint_type' to 'int', possible loss of data 1> Generating Code... Any help will be appreciated Regards Stavros Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted February 11, 2015 Report Share Posted February 11, 2015 'To disable deprecation, use _CRT_SECURE_NO_WARNINGS.' Have you tried this? stzog 1 Quote Link to comment Share on other sites More sharing options...
stzog Posted February 11, 2015 Author Report Share Posted February 11, 2015 No.. Quote Link to comment Share on other sites More sharing options...
stzog Posted February 11, 2015 Author Report Share Posted February 11, 2015 'To disable deprecation, use _CRT_SECURE_NO_WARNINGS.' Have you tried this? Ok Thanx a lot!!!I solved it following your advice!!But what was the problem??? Quote Link to comment Share on other sites More sharing options...
apfitch Posted February 12, 2015 Report Share Posted February 12, 2015 There was no problem. Right at the bottom of the messages you'll see "Generating Code", so your program did compile. regards Alan P.S. , The warnings were the nice people at Microsoft telling you that the function sprintf is potentially unsafe (as it doesn't have any bounds checking). David Black 1 Quote Link to comment Share on other sites More sharing options...
dakupoto Posted February 13, 2015 Report Share Posted February 13, 2015 There was no problem. Right at the bottom of the messages you'll see "Generating Code", so your program did compile. regards Alan P.S. , The warnings were the nice people at Microsoft telling you that the function sprintf is potentially unsafe (as it doesn't have any bounds checking). "sprintf" is a very powerful function to write a sequence of bytes according to specified format into a buffer. Most importantly, as the OP is trying to model a packet switch, and packets are always of a certain size, the size constraint must be rigorously enforced by the packet switch, and in fact in real world devices,extra bytes are put into a separate packet, to enforce the rule. Hope that helps. Quote Link to comment Share on other sites More sharing options...
stzog Posted February 16, 2015 Author Report Share Posted February 16, 2015 Ok thanks o lot for your precious help. I have managed to run succesfully the switch in systemc according to its specifications. One more question... Is there any way to implement the switch in VHDL consdering that i have the SystemC code??? Regards Stavros 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.