[splint-discuss] SPLINT sysmac.h error

Ludolf Holzheid lholzheid at bihl-wiedemann.de
Tue Jul 17 09:55:14 EDT 2007


On Tue, 2007-07-17 09:42:48 +0100, Asim Zaka wrote:
> [..]
> </font>Maybe you would like to add support in lint for IAR compiler for
> code which uses string.h.<br><br>

As I wrote in the other mail, adding a 'sizeof' operator to an
ISO/ANSI compatible preprocessor doesn't make any sense, as it would
have to return the same value for all integer types.

I don't think anyone would like to add support for that non-standard
compiler extension which would work as expected for the H8 IAR
compiler only.


On Tue, 2007-07-17 08:44:34 +0100, Asim Zaka wrote:
> <html>
> <body>
> Hi,<br><br>
> Would it be possible for you to send these headers to me?<br><br>
> So there is no splint switch or setting or way around it as long as my C
> source includes the string.h file.<br><br>

The changed headers are part of a work for a customer, so I don't own
the copyright and cannot disclose it, sorry.

Moreover, it has been a safety-related project, so I had to avoid
library routines as far as possible. I did not use headers including
sysmac.h and did not adapt it.

But it is easy to do it yourself:

 o Make a copy of the IAR 'inc' directory (e.g. to 'splint-inc' in the
   project source directory)

 o remove or comment-out the offending lines (see the patch attached)

 o in splint's include search path, replace the IAR directory with
   the new one


Another possibility to get rid of _this_ error is to add the IAR
directory to the include search path (-I flag) and to the list of
system directories (-sysdirs flag) and specifying '-sysdirerrors' (and
an appropriate library such as +ansilib). This may help for the
standard headers, but will not help for the sfrb/sfrw declarations.

Ludolf


P.S.: I would really appreciate if you could figure out how to
      configure your Eudora to send plain text mails.

-- 

---------------------------------------------------------------
Ludolf Holzheid             Tel:    +49 621 339960
Bihl+Wiedemann GmbH         Fax:    +49 621 3392239
Floßwörthstraße 41          e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------
-------------- next part --------------
--- inc\sysmac.h	Thu Feb 28 11:36:36 2002
+++ splint-inc\sysmac.h	Tue Jul 17 14:59:03 2007
@@ -49,19 +49,19 @@
 #endif
 
 #ifndef __SIZE_T_TYPE__
-#if     sizeof((char*)0 - (char*)0) <= sizeof(int)
+/*#if     sizeof((char*)0 - (char*)0) <= sizeof(int)*/
 #define __SIZE_T_TYPE__ unsigned int
-#else
-#define __SIZE_T_TYPE__ unsigned long 
-#endif
+/*#else*/
+/*#define __SIZE_T_TYPE__ unsigned long */
+/*#endif*/
 #endif
 
 #ifndef __PTRDIFF_T_TYPE__
-#if     sizeof((char*)0 - (char*)0) <= sizeof(int)
+/*#if     sizeof((char*)0 - (char*)0) <= sizeof(int)*/
 #define __PTRDIFF_T_TYPE__ unsigned int
-#else
-#define __PTRDIFF_T_TYPE__ unsigned long 
-#endif
+/*#else*/
+/*#define __PTRDIFF_T_TYPE__ unsigned long */
+/*#endif*/
 #endif
 
 #ifndef __JMP_BUF_ELEMENT_TYPE__


More information about the splint-discuss mailing list