Jump to content
stzog

Build errors

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

Share this post


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

Share this post


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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×