The Newlib assert() function calls the fiprintf function which is not supported by the Nios® II Small C library. However, you can use assert() by modifying it to use fprintf instead of fiprintf. To do this copy the <nios2 install directory>/bin/nios2-gnutools/src/newlib/newlib/libc/stdlib/assert.c file into your system library project. Then modify the call to fiprint to call fprintf instead. In other words, change the following code:
(void)fiprintf(stderr, "assertion \%s\ failed: file \%s\, line %d\n", failedexpr, file, line);
to read:
(void)fprintf(stderr, "assertion \%s\ failed: file \%s\, line %d\n", failedexpr, file, line);
Then save the modified assert.c file and recompile your project. The compiler will now pick up the local copy of assert.c instead of the library version.