Path: utzoo!utgpu!cunews!mitel!melair!dataco!amodeo From: amodeo@dataco.UUCP (Roy Amodeo) Newsgroups: comp.lang.c Subject: Re: ANSI C -> non-ANSI C Message-ID: <308@dcsun21.dataco.UUCP> Date: 5 Dec 90 01:47:21 GMT References: <90335.163132TRM900@psuvm.psu.edu> <14630@smoke.brl.mil> <2880@lupine.NCD.COM> Reply-To: amodeo@dcsun03.UUCP (Roy Amodeo,DC ) Organization: Canadian Marconi Company (Datacomm), Ottawa, Ontario Lines: 35 In article <2880@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: > >What I have always planned on doing (if I ever get the time) is to simply >add another (optional) warning to GCC which would warn you about all >actual parameters to (prototyped) functions which get an implicit change >of representation by virtue of being passed into a formal parameter of >a sufficiently different type to require such a change of representation. >Then the programmer could edit his/her own code (adding explicit type >casts as necessary) until all of these warnings went away. At that point, >unprotoization could be done safely. The cross-compiler we bought for our development work does this. When you first kick this in, people grumble and complain loudly. They eventually add casts to make the noise go away. And sometimes they find that they had arguments in the wrong order or that they were feeding a routine the wrong data. I would suggest that if you do put in this warning, make it the default. If you *must*, allow a user to turn it off with a command line option. This kind of thing goes well with warnings about calling functions with no prototypes. But then, I'm the weak-memoried type that strong typing was meant for. >Here is a better example of the problem: > > extern f (double); > > ... f (3); ... > I don't suppose you can say 3d or 3.0L for (double)3 can you? That would be a little less obnoxious. rba iv - a foolish signature is the hobgoblin of little minds nrcaer!dataco!amodeo Brought to you by Super Global Mega Corp .com