[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few problems...



On Sat, 29 Jan 2000, Christian Reiniger wrote:

>Bjarke Hammersholt Roune wrote:

>>If a parameter of a function has a default parameter, it must be
>>specified in the declaration only, and thus cannot be redefined in the
>>definition of said function, even if the values assigned by default are
>>identical. I don't know if this is MSVC being lame, or if gcc is
>>allowing something it shouldn't (I assume it compiles for you, and that
>>you use gcc). In any case, MSVC won't have it.
>
>Strange. g++ *should* at least warn me. Where does this occur? I couldn't
>find it here.

g++ has always warned me when I do that same mistake (cut'n'paste
programming). At least the newer versions (since egcs and newer). I use
the switches '-Wall -pedantic', and they force me to write quite valid
C++. A program with a warning is considered a buggy program... :-)

---------------------+------------------------------------------------------
 Jan 'Chakie' Ekholm |    CS at Åbo Akademi University, Turku, Finland
    Linux Inside     | I'm the blue screen of death, no-one hears you scream