On Thu, May 02, 2002 at 04:27:30PM +0200, Joerg Schilling wrote:
> 
> >From [EMAIL PROTECTED] Wed May  1 18:05:15 2002
> 
> >> >From: Norbert Preining <[EMAIL PROTECTED]>
> >> 
> >> >On Mit, 17 Apr 2002, Anssi Saari wrote:
> >> >> -       fprintf(stderr, "\nUse %s -help\n");
> >> >> +       fprintf(stderr, "\nUse %s -help\n", program_name);
> >> 
> >> >Well, if it runs correctly on solaris, isn't solaris broken ;-)
> >> 
> >> Neither this statement is correct, nor the quoting!
> >> 
> >> It runs perfectly on a Sparc system! < READ THIS >
> >> 
> >> 
> >> Sparc has just a more robust argument passing scheme.
> 
> >You mean it makes up a better nonsense value than Intel systems? Compiling
> >on Linux with -Wall, you are told about this, of course, as well as a raft
> >of other dubious programming issues. Add -ansi and -pedantic to find out
> >how clean the code really is. Hint: use the script command or redirect
> >error output to a file.
> 
> 
> It seems that you never used a compiler with decent warnings and you never
> really used the warning features of GCC.

The original problem here was just that an fprintf was written wrong,
and since the documentation for fprintf on most unix flavours state that
the result when there are insuficient arguments passed for the variables,
the result is undefined, it is perfectly correct for solaris to fill in
null or blank for an undefined argument, and for linux to pass in random
garbage if it wants to. No unix I have worked with makes any garentees
about undefined behaviour.  The patch is probably correct, or at the
very least there is a bug that needs fixing in that line.

gcc's -Wall will complain about many things that are irrelevant or
correct, but any complaint about the line in question is most certainly
valid.

> Unfortunately you may only select between no warnings and too many warnings.

So non of these are of any use?
-Wtrigraphs               Warn if trigraphs are encountered
-Wno-trigraphs            Do not warn about trigraphs
-Wcomment{s}              Warn if one comment starts inside another
-Wno-comment{s}           Do not warn about comments
-Wtraditional             Warn if a macro argument is/would be turned into
                          a string if -traditional is specified
-Wno-traditional          Do not warn about stringification
-Wundef                   Warn if an undefined macro is used by #if
-Wno-undef                Do not warn about testing undefined macros
-Wimport                  Warn about the use of the #import directive
-Wno-import               Do not warn about the use of #import
-Werror                   Treat all warnings as errors
-Wno-error                Do not treat warnings as errors
-Wall                     Enable all preprocessor warnings

I have seen commercial compilers with more options, but it is certainly
more than all or nothing.

> In addition, it is not possible to do portable development on Linux and for
> this reason, cdrecord is developed on Solaris using the Sun C-compiler.
> As the probpem is only seen if you run lint, and as ...... I believe you 
> will not read it, so why write it?

Can't do portable development on BSD either, or probably Solaris for
that matter.  Each unix has just enough quirks that you need to put a
few conditions in to deal with different unix flavours.  It is a pain,
but one developers of "portable" software just have to deal with.

Lennart Sorensen


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to