M
Mantorok Redgormor
Dik T. Winter said:How wrong you are. Many cases of undefined behaviour are not detectable.
On the other hand, getting a program "lint free" could be a considerable
effort; even for programs that were completely portable.
Ensuring a program is lint free is impossible.
The following is an example:
[ -------- a.c ---------- ]
#include <stdio.h>
int main(void)
{
printf("Hello world\n");
return 0;
}
[ -------- a.c ---------- ]
splint -strict a.c
Splint 3.0.1.6 --- 26 Feb 2002
a.c: (in function main)
a.c:4:5: Called procedure printf may access file system state, but globals list
does not include globals fileSystem
A called function uses internal state, but the globals list for the function
being checked does not include internalState (Use -internalglobs to inhibit
warning)
a.c:4:5: Undocumented modification of file system state possible from call to
printf: printf("Hello world\n")
report undocumented file system modifications (applies to unspecified
functions if modnomods is set) (Use -modfilesys to inhibit warning)
Finished checking --- 2 code warnings
I am not even sure what is wrong with accessing the file system
or what in the world a "file system state" is.
The warning seems to be rather bizarre and I don't even
know if it is important.