OON: const arguments

From: Thiago Andre (ThiagoAndre@demec.ufpe.br)
Date: Mon May 29 2000 - 15:06:12 EST


I use to have in my work computer an egcs compiler but my workplace changed all compilators to the new version of gcc, the 2.95.2(I guess), and now I'm having this kind of problem: take for example a routine witch get a &int as argument, like this:

int function(int &a)
{
   return a++;
}

Using the egcs, when I compile this routine it will give me a "warning" saying that if I use a const on the argument of this routine, wont happen anything. Here's the deal, if I declare in my program: " int b = 3 " and call the routine like this: " function(b) " ; my integer b become a 4 (four) however if I call the very same routine like this: " function(3) " the 3 (three) will never become a 4 (four) because beside being a integer 3 (three) is also a const. So here's my problem, if I compile this routine with the new compilator version it will give a compilation error instead the usual " warning" and because of that all my basic classes and data structures aren't working, and that's driving me crazy, so here's my question: " Is there something I can do to beside change back my compilator or fix ALL my codes? "

Thanks,
            Thiago Silva

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:13 EST