Path: utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!mailrus!purdue!haven!vrdxhq!edm From: edm@vrdxhq.verdix.com (Ed Matthews) Newsgroups: comp.lang.c Subject: Re: Warning messages Keywords: large projects Message-ID: <25364@vrdxhq.verdix.com> Date: 12 Jan 90 16:16:19 GMT References: <1471@mdbs.UUCP> <2NNQZ%@rpi.edu> Reply-To: edm@vrdxhq.UUCP (Ed Matthews) Organization: Verdix Corporation HQ Lines: 40 In article <2NNQZ%@rpi.edu> adamsf@turing.cs.rpi.edu (Frank Adams) writes: >Warning messages are fine for small programs, where one person can >read them all and understand them. But for a large or medium sized >program, requiring anywhere from three programmers on up, they don't work. I tend to agree with you in general. >The obvious solution is to make the compiler treat warnings as errors, and >this is indeed what I am advocating. But this runs smack into the second >problem: sometimes, the situation being warned about is exactly what you want >to do. > >To deal with this, I propose introduction of a pragma, with the syntax: > >#pragma permit This does not seem like an optimal solution to me. Semantic interpretation of warnings is a function of the environment, not of the compiler. For example, the environment may disallow you to make public any unit which has warnings. This is the level at which warnings should be enforced. The environment should allow, on a case-by-case basis, units with warnings to be made public when the unit has been reviewed and explicit authorization to make that unit public has been given. Note that your solution requires explicit modification of the source code. This requires, at a minimum, recompilation of one unit, and potentially recompilation of a lot of units. Furthermore, should conditions change and you decide that wish to once again treat the warning as an error, you must go back in and modify the unit and suffer the recompilation penalty. NOTES: I have done most of my programming in Ada, for which it has long been recognized that an environment is necessary. Environments for C seem to be scarcer, though becoming more common. For lack of time, I don't follow comp.lang.c, so if anyone wants to discuss this further, e-mail is best. -- Ed Matthews edm@verdix.com Verdix Corporation Headquarters (703) 378-7600 Chantilly, Virginia