This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

different explicit instantiation in gcc-2.8.1 and egcs-1.1


Hi there !

  I'm used g++ extensively under UNIX (AIX,IRIX,OSF,..) using GNU'
recommended approach to template instantiation (#pragma interface,
#pragma implementation and explicit instantiation). I'm more and more
beginning to like this method, because it's the only that prevents me
from recopiling tons of source code as in all 'automatic' instantiation
approaches (i.e.: MipsPro compiler 7.x under IRIX(SGI)).

  There's one major difference in the syntax of explicit instantiation
betweeen gcc-2.8.1 and egcs-1.1:

 Under gcc-2.8.1 it suffices to write

   template operator<<(ostream &,const smanip<int> &);

whereas under egcs-1.1 (CygWin 20B) you must specify the return type
too, otherwise you get the error message 'no matching template for
explicit instantiation...':

   template ostream & operator<<(ostream &,const smanip<int> &);

  I the view of my eyes specifying the return type is obsolete, since a
function is uniquely defined by its name and argument types. The second
convetion runs under both, gcc and egcs, but I liked to use the short
form without return type, because it allows for 'semi-automatic'
instantiations derived from 'missing symbol' errors from the linker,
which contain only the functions name and argument types (possibly in
C++-mangled  style (refer to binutils c++-filt tool)).

 So could sombody tell me, which syntax is the syntax from the
correspondad ANSI working paper and how egcs and/or gcc will behave in
future versions ? 

  Thanks in advance,
  
     Wolfgang

--
Mag. Wolfgang Glas
Institut fuer hydraulische Stroemungsmaschinen
Kopernikusgasse 24                              Phone:++43/316/873/7578
A-8010 Graz                                     Fax:  ++43/316/873/7577

mailto:Wolfgang.Glas@hfm.tu-graz.ac.at   
http://fhysmsg01.tu-graz.ac.at/Wolfgang.Glas/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]