From: Alex Newsgroups: comp.os.msdos.djgpp Subject: Function problems with GCC 3.1 Date: Tue, 03 Sep 2002 10:36:21 +0200 Organization: UNIVERSIDAD POLITECNICA DE VALENCIA Lines: 48 Message-ID: <3D747484.2A69A5AB@bigfoot.com> NNTP-Posting-Host: empresa2.cc.upv.es Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: polaris.cc.upv.es 1031042182 22065 158.42.25.103 (3 Sep 2002 08:36:22 GMT) X-Complaints-To: newsmaster AT upv DOT es NNTP-Posting-Date: 3 Sep 2002 08:36:22 GMT X-Mailer: Mozilla 4.5 [es] (Win98; I) X-Accept-Language: es To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie 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 --