Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

SmallC and sscanf

Altera_Forum
Honored Contributor II
1,356 Views

Hi folks- 

 

In my NIOS2 project I started using sscanf() to parse text strings. The linker complains that sscanf is not found. Research tells me turn off the SmallC option on the nios2-elf-gcc command line (disable "-msmallc"). Looking at the properties of project, nios2-elf-gcc doesn't explicitly state the -msmallc option. So I conclude there must be another way to control the use of the SmallC library. 

 

Can anyone tell me the right way to turn on link support for sscanf()? 

 

Thanks, John.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
623 Views

Actually I would generally avoid using any of the scanf family of functions. They are very difficult to use properly - ie verifying all input and without leaving the code open to expliots. 

Use strtoul() and friends to parse numbers and str* (but not strtok) for stings.
0 Kudos
Altera_Forum
Honored Contributor II
623 Views

It turns out exclusion or inclusion of the Small C library is controlled using a checkbox in the System Library Properties dialog box. 

 

JJS
0 Kudos
Reply