#2241 closed defect (fixed)

testsuites/psxtests/psx07/init.c:46: bad call to printf ?

Reported by: David Binderman Owned by: Gedare Bloom <gedare@…>
Priority: low Milestone: 4.11
Component: unspecified Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

[rtems/testsuites/psxtests/psx07/init.c:46]: (error) printf format string requires 1 parameter but only 0 are given.

printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );

Some duplicates:

[rtems/testsuites/psxtests/psx09/init.c:48]: (error) printf format string requires 1 parameter but only 0 are given.
[rtems/testsuites/psxtests/psx12/init.c:44]: (error) printf format string requires 1 parameter but only 0 are given.

Change History (4)

comment:1 Changed on Jan 23, 2015 at 3:26:55 PM by Joel Sherrill

Wow! git blame says I am responsible for that code. I hope you don't blame me for not remembering it after over 17 years. :)

c123a084 (Joel Sherrill 1996-08-07 15:52:30 +0000 46) printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );

I think it should have prefix as the argument like the other printf's in this method. What do you think?

comment:2 Changed on Jan 23, 2015 at 3:27:41 PM by Joel Sherrill

And which target/BSP caught this? I have been hunting warnings and haven't focused a lot on the tests but am surprised I haven't see that.

Hmm.. now that I think about it, I don't know how this path could even be compiled. We have has POSIX Sporadic Server support for a LONG LONG time. Are you using the right toolset? A hacked version of RTEMS?

I am fixing the problem but actually just don't see how this code could be tripped.

Last edited on Jan 23, 2015 at 3:32:17 PM by Joel Sherrill (previous) (diff)

comment:3 Changed on Jan 23, 2015 at 4:21:55 PM by David Binderman

And which target/BSP caught this?

I used a C / C++ static analyser called cppcheck, available from sourceforge.

The analyser just looks at source code. As a reminder, the priority is set to low.

comment:4 Changed on Feb 23, 2015 at 3:00:03 PM by Gedare Bloom <gedare@…>

Owner: set to Gedare Bloom <gedare@…>
Resolution: fixed
Status: newclosed

In 83fe4468bc3b0d9008ea3a4768bceee42895b510/rtems:

psxtests: add string param to printf. closes #2241

Note: See TracTickets for help on using tickets.