473,801 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ignore include header files with Splint

I am currently working in Aisin-AW, in development of navigation
systems (embedded SW).
Since a few weeks, we are checking our source code with splint.

We encounter this problem. I hope this mailing-list can help us to
solve
it :

Our team is responsible of 1 module.
In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.

How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?

For example, this is not working and we wonder why :
/*@ignore@*/
#include bad_file.h
/*@end@*/

warnings in "bad_file.h " are displayed, anyway.

thank you in advance !
Nov 14 '05 #1
9 5367
Henry Fr?d?ric wrote:
[snip]
How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?

For example, this is not working and we wonder why :
/*@ignore@*/
#include bad_file.h
/*@end@*/

warnings in "bad_file.h " are displayed, anyway.


May I ask why you think the C language specifies how splint should work?
Nov 14 '05 #2
Henry Fr?d?ric wrote:
.... snip ...
How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?


Specific compilers etc. are Off Topic in c.l.c. The subject is
limited to the portable C language, as specified in the standard.

Try the splint mailing list.

--
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
Nov 14 '05 #3

In article <cd************ **************@ posting.google. com>, fr************@ awtce.be (Henry Fr?d?ric) writes:
I am currently working in Aisin-AW, in development of navigation
systems (embedded SW).
Since a few weeks, we are checking our source code with splint.

We encounter this problem. I hope this mailing-list can help us to
solve it :


Splint and other lint tools, though they may be closely related to C,
are not covered by the C language specification; thus they are not,
in the opinion of most of the comp.lang.c regulars, topical here.
(There are arguments for and against this opinion which need not be
rehashed, as they are available to anyone with access to Google's
archives.) Please note that the comp.lang.c FAQ and other materials
for new readers explain what is, and is not, generally considered
topical (by most of the regulars).

While you may be lucky enough to have a Splint expert read your
question here and respond to it, I suspect you would do better to
ask the Splint developers, or consult the documentation. I am not
personally familiar with all of the documentation on the Splint
website (www.splint.org), but there does seem to be quite a lot of
it.

Incidentally, comp.lang.c is not a mailing list. It's a Usenet
newsgroup, which is quite a different thing. There are several
"introducti on to the Internet" resources which can explain the
difference.

--
Michael Wojcik mi************@ microfocus.com

Painful lark, labouring to rise!
The solemn mallet says:
In the grave's slot
he lies. We rot. -- Basil Bunting
Nov 14 '05 #4
Henry Fr?d?ric wrote:
I am currently working in Aisin-AW, in development of navigation
systems (embedded SW).
Since a few weeks, we are checking our source code with splint.

We encounter this problem. I hope this mailing-list can help us to
solve
it :

Our team is responsible of 1 module.
In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.

How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?

For example, this is not working and we wonder why :
/*@ignore@*/
#include bad_file.h
/*@end@*/
<OT>
Read the manual on header file inclusion (somewhere in chapter 14 IIRC)
about system headers and similar; if that does not help, use
/*@ignore@*/ .... /*@end@*/ _within_ the header file. If this is not
applicable in your case, ask in the splint mailing list.
</OT>
warnings in "bad_file.h " are displayed, anyway.


Please note that this is not topical in comp.lang.c.
Try: http://www.splint.org/lists.html
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #5
"Henry Fr?d?ric" <fr************ @awtce.be> wrote in message
I am currently working in Aisin-AW, in development of navigation
systems (embedded SW).
Since a few weeks, we are checking our source code with splint.

We encounter this problem. I hope this mailing-list can help us to
solve
it :

Our team is responsible of 1 module.
In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.

How can we use splint in order to parse those files (necessary for
definitions), but without getting any warning ?

For example, this is not working and we wonder why :
/*@ignore@*/
#include bad_file.h
/*@end@*/

warnings in "bad_file.h " are displayed, anyway.

Have you tried putting /*@ignore@*/... /*@end@*/ inside the <bad_file.h>
header file? If so, this sound as a splint bug, check their maillist and
buglist, before posting a bug report.

Regarding topicality of lint like tools here, it show that most C
programmers are too ignorant on using such tools. PvdL say:

"Separating lint out from the compiler as an independent program was a
big mistake that people are only now coming to terms with."

A cool feature with splint, is that the tool also add security checks on
e.g. formatstrings and buffer overflow vulnerabilities . People here
complain about a "worse is better" xmalloc,

http://www.ai.mit.edu/docs/articles/...tion3.2.1.html

but don't wanna hear about exstensive program checking. lol
--
Tor <torust AT online DOT no>
"To this day, many C programmers believe that 'strong typing' just means
pounding extra hard on the keyboard". PvdL
Nov 14 '05 #6

In article <HL************ ******@news2.e. nsc.no>, "Tor Rustad" <to****@online. no.spam> writes:
"Henry Fr?d?ric" <fr************ @awtce.be> wrote in message

In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.


Have you tried putting /*@ignore@*/... /*@end@*/ inside the <bad_file.h>
header file?


Presumably not, as the OP explicitly states that this is forbidden.

--
Michael Wojcik mi************@ microfocus.com
Nov 14 '05 #7
mw*****@newsguy .com (Michael Wojcik) wrote in message news:<d1******* **@news4.newsgu y.com>...
In article <HL************ ******@news2.e. nsc.no>, "Tor Rustad" <to****@online. no.spam> writes:
"Henry Fr?d?ric" <fr************ @awtce.be> wrote in message

In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify them.


Have you tried putting /*@ignore@*/... /*@end@*/ inside the <bad_file.h>
header file?


Presumably not, as the OP explicitly states that this is forbidden.


I can't proceed on this way because I can't modify the <bad_file.h>
Nov 14 '05 #8
Henry Fr?d?ric wrote:
mw*****@newsguy .com (Michael Wojcik) wrote in message
"Tor Rustad" <to****@online. no.spam> writes:
"Henry Fr?d?ric" <fr************ @awtce.be> wrote in message

In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot
modify them.

Have you tried putting /*@ignore@*/... /*@end@*/ inside the
<bad_file.h> header file?


Presumably not, as the OP explicitly states that this is
forbidden.


I can't proceed on this way because I can't modify the
<bad_file.h>


I distinctly recall telling you how to intercept its use without
altering the actual file. I did this in some newsgroup where you
were not off-topic.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #9
"Michael Wojcik" <mw*****@newsgu y.com> wrote in message

In article <HL************ ******@news2.e. nsc.no>, "Tor Rustad"

<to****@online. no.spam> writes:
"Henry Fr?d?ric" <fr************ @awtce.be> wrote in message

In our C files, we include Header files from others modules.
Those files contain splint errors/warnings, but we cannot modify
them.
Have you tried putting /*@ignore@*/... /*@end@*/ inside the <bad_file.h> header file?


Presumably not, as the OP explicitly states that this is forbidden.


Then make a copy of the header file... for splint analysis.

--
Tor <torust AT online DOT no>

Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
3892
by: Ramesh | last post by:
Hi, I am currently maintaining a legacy code with a very very large code base. I am facing problems with C/C++ files having a lot of un-necessary #includes. On an average every C/C++ file has around 150+ .h files included. I find 75% of the files unnecessary and could be removed. Considering the fact that I have a huge code base, I can't manually fix it. Are there any tools that would report un wanted .h files?
44
3417
by: Neil Cerutti | last post by:
In Rob Pike's style guide he urges the following: Simple rule: include files should never include include files. If instead they state (in comments or implicitly) what files they need to have included first, the problem of deciding which files to include is pushed to the user (programmer) but in a way that's easy to handle and that, by construction, avoids multiple inclusions. I was startled by this guideline, since...
12
1986
by: Francois Grieu | last post by:
Can #include safely use a preprocessing token, as in #define HEADERFILE "stdio.h" #include HEADERFILE int main(void) {return printf("Hello, world\n")*0;} TIA, François Grieu
14
22374
by: Pedro Graca | last post by:
Imagine I have a structure with a size_t member: /* foo.h */ struct foo { char const *bar; size_t barlen; }; void make_foo(struct foo *p);
14
6707
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping" process I am introducing namespaces to properly compartmentalise sections of the code into logical units. What I am speciffically trying to get right is the dependency tree for header files to reduce compile time and simplify the code structure. On...
5
8693
by: ma740988 | last post by:
Consider the source: # include <iostream> # include <string> # include <fstream> # include <vector> # include <sstream> using namespace std;
9
4044
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
9
3466
by: Justme | last post by:
Novice programmer needs help with using fgets to read and ignore the first two lines of a file. I've gone thru the previous posting regarding fgets, but none of them seems to help my situation. I have airdata file that i have to read, but in other teh fscanf to work properly, i need to ignore the first two lines, because scanf does not read spaces. This is what my current code looks like #include <stdio.h>
8
2146
by: The Cool Giraffe | last post by:
One thing i do know for sure. When one creates a CPP file, one needs to include the H file. Now, having said that, i wonder if there are some general hints, requirements or standard guide lines on what and how to include. Suppose that we have a project consisting of a number of classes and structs. Some of them using the others, some using all of them. What is a good approach when including? --
0
9555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10515
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10260
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10049
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7589
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6827
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.