lkml.org 
[lkml]   [1996]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ideas
On Wed, 8 May 1996, Brian M Grunkemeyer wrote:

> Have you looked at the differences between using gcc -Wall and g++
> (without -Wall)? It really does let a lot of things slip by. From
> init/main.c,
> g++ caught several additional types of (small?) errors: not handling
> values falling through switch statements,
Could you please clarify?

> comparisons between signed and unsigned ints,
g++ w/o -Wall won't catch this. (Never mind the fact that gcc won't
catch it at all.)

> unused parameters galore,
Conceded.

> and "illegal" conversion from int (*)(void*) to int(*)(char*).
> While none of these are really
> critical and C probably handles them all for us, it wouldn't hurt to
> make the types more clear and attempt to handle illegal inputs to
> procedures. Makes reading the code and tracking down bugs easier.
>

My main objection is that the kernel is written in C, not C++, and no
matter how similar the languages may be, C is *not* C++, despite being
very similar. The items above that do not generate warnings, IMHO, do
not do so because there's nothing wrong with those constructs. (Mind
you, I think it'd be nice if gcc could be made to warn about unused
parameters.)

On the other hand, we could go whole hog, and run it through that program
that was discussed here recently, or maybe just plain lint.

--
J. Sean Connell Systems Software Analyst, ICONZ
diamond@canuck.gen.nz "Oh life is a glorious cycle of song,
diamond@iconz.co.nz a medley of extemporanea,
#include <stddisc.h> And love is a thing that can never go wrong...
And I'm Queen Marie of Romania."
I *hate* Sun Type 4 kbs! --Dorothy Parker



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.062 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site