#1644 closed defect (fixed)

testsuites/tmtests/tm30/../../support/src/tmtests_support.c:46:3: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: unspecified Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

# sparc64-rtems4.11-gcc -B../../../../../usiii/lib/ -specs bsp_specs -qrtems -DPACKAGE_NAME=\"rtems-c-src-tests-tmtests\" -DPACKAGE_TARNAME=\"rtems-c-src-tests-tmtests\" -DPACKAGE_VERSION=\"4.10.99.0\" -DPACKAGE_STRING=\"rtems-c-src-tests-tmtests\ 4.10.99.0\" -DPACKAGE_BUGREPORT=\"http://www.rtems.org/bugzilla\" -DPACKAGE_URL=\"\" -DRTEMS_TEST_NO_PAUSE=1 -I. -I../../../../../../../c/src/../../testsuites/tmtests/tm30 -I../../../../../../../c/src/../../testsuites/tmtests/include -DOPERATION_COUNT=100 -I../../../../../../../c/src/../../testsuites/tmtests/../support/include -mcpu=ultrasparc3 -DUS3 -DSUN4U -gstabs -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT tmtests_support.o -MD -MP -MF .deps/tmtests_support.Tpo -c -o tmtests_support.o test -f '../../support/src/tmtests_support.c' || echo '../../../../../../../c/src/../../testsuites/tmtests/tm30/'../../support/src/tmtests_support.c
../../../../../../../c/src/../../testsuites/tmtests/tm30/../../support/src/tmtests_support.c: In function 'rtems_time_test_measure_operation':
../../../../../../../c/src/../../testsuites/tmtests/tm30/../../support/src/tmtests_support.c:46:3: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

AFAIS, this warning originates from this change:

--- tmtests_support.c 21 Jun 2010 16:54:17 -0000 1.1
+++ tmtests_support.c 25 Jun 2010 16:59:06 -0000 1.2
@@ -6,7 +6,7 @@

  • * $Id: tmtests_support.c,v 1.1 2010/06/21 16:54:17 joel Exp $

+ * $Id: tmtests_support.c,v 1.2 2010/06/25 16:59:06 joel Exp $

*/


#include <bsp.h>

@@ -27,9 +27,9 @@

int overhead

)
{

  • int i;
  • int loop_overhead;
  • int end_time;

+ int i;
+ long loop_overhead;
+ int end_time;

benchmark_timer_initialize();

for (i=0 ; i<iterations ; i++ ) {

This causes an fprintf format string mismatch in put_time (uses PRId32, i.e. expects a 32bit type) on 64bit targets.

=> either put_time needs to be changed or
this "long" be replaced with a 32bit type.

Change History (3)

comment:1 Changed on Nov 15, 2010 at 5:39:22 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Closing .. no comments since fixed in cvs.

comment:2 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:3 Changed on Oct 10, 2017 at 6:35:44 AM by Sebastian Huber

Component: miscunspecified
Note: See TracTickets for help on using tickets.