From: "bin" Newsgroups: comp.os.msdos.djgpp References: <3D747484 DOT 2A69A5AB AT bigfoot DOT com> Subject: Re: Function problems with GCC 3.1 Date: Wed, 4 Sep 2002 21:51:53 +0200 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.199.144.65 Message-ID: <3d76565e@news.012.net.il> X-Trace: news.012.net.il 1031165534 212.199.144.65 (4 Sep 2002 21:52:14 +0300) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com foo.h--------------- void f(int a1, int a2=127); foo.cc-------------- void f(int a1, int a2) { //some code } Change header files only, then you can write simple script to add comments into.cc files ;) Anyway, smth wrong with software design, if you need at least 104 functions with default arguments ;) "Alex" wrote in message news:3D747484 DOT 2A69A5AB AT bigfoot DOT com... > Hello. > > I have a program that compile ok in djgpp 2.03 with gcc 2.95. > > I migrated to gcc 3.1 with lots of problems. > > I'm solving them but one is annoying me: > > foo.h > void f(int a,char b=1); > > foo.cc > #include "foo.h" > void f(int a,char b=1) > { > //some code > } > > When compiling I get the next error: > > foo.cc: 4692: default argument given for parameter 2 of > 'void f(int,char=1)' > foo.h:29: after previous specification in 'void f(int a,char b=1)' > > If in foo.cc I change the definition to 'void f(int a,char b)' it > compiles. > > The problem is: > > a) I can't see the default value of 'b' without open > foo.h (or add a comment to the function in foo.cc) > I have 104 header files and is very annoying opening them > each time I want to work with its .cc file. > More annoying is open 104 .cc files to add a comment > to each function to comment a thing that was > auto-commented in gcc 2.95. > > b) I have to modify 104 .cc files with hundreds of functions > to change te definition of the functions. > > Any suggerences? > > Thanks in advance. > > -- Alex -- > > >