home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!idiap.CH!tmb
- From: tmb@idiap.CH (Thomas M. Breuel)
- Subject: mailer/gateway problem
- Message-ID: <9301031100.AA16265@idiap.ch>
- Sender: gnulists@ai.mit.edu
- Reply-To: tmb@idiap.ch
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Sun, 3 Jan 1993 13:00:40 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 75
-
- I sent the letter reproduced below to "bug-g++@ai.mit.edu". First, it
- got gatewayed to "gnu.g++.help" and "comp.lang.c++". That is not what
- I wanted. It definitely shouldn't have ended up in either of these
- newsgroups. I also don't think it is a good idea to gateway _any_ g++
- related traffic to "comp.lang.c++".
-
- Please check your mail aliases, and please forward the message to
- the appropriate mailing list.
-
- Thanks,
- Thomas.
-
-
- To: bug-g++@ai.mit.edu
- Subject: gcc (C++) 2.3.2 generates bad assembly language output (redefined symbol)
-
-
- gcc -v -c foo.cc
- Reading specs from /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/specs
- gcc version 2.3.2
- /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix foo.cc /local/tmp/cca11717.i
- GNU CPP version 2.3.2 (sparc)
- /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.2/cc1plus /local/tmp/cca11717.i -quiet -dumpbase foo.cc -version -o /local/tmp/cca11717.s
- GNU C++ version 2.3.2 (sparc) compiled by GNU C version 2.3.2.
- as -o foo.o /local/tmp/cca11717.s
- as: "/local/tmp/cca11717.s", line 96: error: redefinition of symbol "_lookup"
- gcc: foo.o: No such file or directory
-
- == foo.cc ======================================================
- #include <std.h>
-
- template <class Y>
- struct NameValuePair {
- char *name;
- Y y;
- };
-
- template <class Y>
- inline Y lookup(NameValuePair<Y> *data,char *name) {
- while(data->name) {
- if(!strcmp(data->name,name)) return data->y;
- data++;
- }
- abort();
- return data->y; // to keep GCC happy
- }
-
- template <class T>
- void swap(T &x,T &y) {
- T temp = x;
- x = y;
- y = temp;
- }
-
- typedef char (*canonicalizer)(char &,float *);
-
- NameValuePair<canonicalizer> canonicalizers[] = {
- {0,0}
- };
-
- typedef float (*extractor)(float &image,float g=2.0);
-
- NameValuePair<extractor> extractors[] = {
- {0,0}
- };
-
- void foo() {
- canonicalizer canonicalize = lookup(canonicalizers,(char*)"foo");
- extractor extract = lookup(extractors,(char*)"bar");
- }
-
- ================================================================
-
-
-
-