From: pavenis AT lanet DOT lv Message-ID: To: Anthony Appleyard , djgpp AT delorie DOT com Date: Tue, 14 Sep 1999 12:18:17 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Subject: Re: djgpp C++ (longnames version) funny with a group generator In-reply-to: <37DD0448.2A2EAF9A@umist.ac.uk> X-mailer: Pegasus Mail for Win32 (v3.12a) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id FAA31240 Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk At first: don't post examples with line numbers as one who will try to help will have to remove them Your code is bad. Earlier compilers allowed that, but now gcc-2.95 generates error by default. You may: use compiler command line option -fpermissive to get warnings instead (don't ask to make in the default, it will not happen) fix the code: for example 'void gp_cursor(const gp_cur & c)' must help. Of course if You're not modifying c there. Or create temporary variable On 13 Sep 99, at 15:03, Anthony Appleyard wrote: > Compiling this program:- > > 1 typedef unsigned char byte; > 2 /*----- row and column on screen */ > 3 class gp_cur{public: byte c,r; > 4 inline gp_cur(byte R=0, byte C=0){c=C; r=R;}; > 5 inline gp_cur(gp_cur &d){c=d.c; r=d.r;}; > 6 inline void operator=(const gp_cur&d){c=d.c; r=d.r;};}; > 7 /*-----*/ > 8 void gp_cursor(gp_cur c) {/* blah blah waffle blah */} > 9 /*-----*/ > 10 main(){ > 11 int X,Y,dy; > 12 gp_cursor(gp_cur(Y-dy,X)); > 13 } > > with the latest version of djgpp caued this error:- > > C:\AM>gcc _err.cc -g _Wall > gcc.exe: _Wall: No such file or directory (ENOENT) > _err.cc: In function `int main()': > _err.cc:12: initialization of non-const reference type `class gp_cur &' > _err.cc:12: from rvalue of type `gp_cur' > _err.cc:5: in passing argument 1 of `gp_cur::gp_cur(gp_cur &)'¡ > > Until a few days ago I was using a version of djgpp that was issued > about October 1996, and the construction quoted here compiled OK > infinity times for me down many years with many versions of djgpp. But > with the latest version of djgpp (which I downloaded so I could use > Win95 long filenames) it causes the fault as above. If I leave line 8 > out, it compiles OK. But when compiling a long working program that I > have that includes this matter, whether with or without line 8, often > the compiler now quits partway and told me to make a bug report, whereas > under my Oct 1996 version of djgpp it always compiled and ran OK. Wot's > goin' on 'ere?? Where is a complete list of known bugs in the latest > current version of djgpp? > > >