<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We are building our RTEMS applications with -std=c99 and other compiler warning switches.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">On the latest RTEMS master and RTEMS 5 toolchain ( from yesterday ), when I include the -std=c99 compiler switch, the compilation fails in an RTEMS header.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Is it not recommended to use the “-std= “ switches when building RTEMS applications, or is this something that we should fix? We are able to use the “-std=c99” switches in 4.11. I noticed that the timestamp.h
file did change between 4.11 and 5.x.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Details of the error are below.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Alan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">It is reproducible with the “hello_world_c” example as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Command from unmodified examples-v2 Makefile:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">sparc-rtems5-gcc --pipe -B/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/ -specs bsp_specs -qrtems -Wall -O2 -g -ffunction-sections -fdata-sections -mcpu=leon3 -c -o o-optimize/test.o test.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Command with -std=c99 added:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">sparc-rtems5-gcc --pipe -B/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/ -specs bsp_specs -qrtems -std=c99 -Wall -O2 -g -ffunction-sections -fdata-sections -mcpu=leon3 -c -o o-optimize/test.o
test.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In file included from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/thread.h:36:0,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/heap.h:22,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/rtems/types.h:26,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems.h:31,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from test.c:5:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h: In function '_Timestamp_Divide':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:219:12: error: incompatible types when assigning to type 'struct timespec' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> _ts_left = sbttots( *_lhs );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:220:13: error: incompatible types when assigning to type 'struct timespec' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> _ts_right = sbttots( *_rhs );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h: In function '_Timestamp_Get_nanoseconds':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:261:7: error: incompatible types when assigning to type 'struct timespec' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> _ts = sbttots( *_time );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h: In function '_Timestamp_Get_as_nanoseconds':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:281:7: error: incompatible types when assigning to type 'struct timespec' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> _ts = sbttots( *_time );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h: In function '_Timestamp_To_timespec':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:299:14: error: incompatible types when assigning to type 'struct timespec' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> *_timespec = sbttots( *_timestamp );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h: In function '_Timestamp_To_timeval':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timestamp.h:313:13: error: incompatible types when assigning to type 'struct timeval' from type 'int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> *_timeval = sbttotv( *_timestamp );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In file included from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timecounter.h:27:0,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/score/timecounterimpl.h:26,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/rtems/clock.h:37,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems.h:40,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from test.c:5:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/sys/timetc.h: At top level:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/sys/timetc.h:72:2: error: unknown type name 'u_int'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> u_int tc_flags;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^~~~~<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In file included from /home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/confdefs.h:326:0,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> from test.c:32:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/imfs.h: In function '_IMFS_get_time':<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">/home/alan/rtems/bsps/5/sparc-rtems5/leon3/lib/include/rtems/imfs.h:343:18: error: storage size of 'now' isn't known<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> struct bintime now;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^~~<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>