Jump to content

Build errors


stzog

Recommended Posts

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

Link to post
Share on other sites

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).

Link to post
Share on other sites

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.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...