Does "complex xxx" work?

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Jun 21 21:28:00 GMT 2003


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

| On Sat, 21 Jun 2003, H. J. Lu wrote:
| 
| > c_common_nodes_and_builtins calls
| > 
| >   (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
| >                                             get_identifier ("complex int"),
| >                                             complex_integer_type_node));
| >   (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
| >                                             get_identifier ("complex float"),
| >                                             complex_float_type_node));
| >   (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL,
| >                                             get_identifier ("complex double"),
| >                                             complex_double_type_node));
| >   (*lang_hooks.decls.pushdecl)
| >     (build_decl (TYPE_DECL, get_identifier ("complex long double"),
| >                  complex_long_double_type_node));
| 
| Debug information, I suspect.  (As names with spaces in, they can't appear
| as identifiers in source code, so shouldn't be useful for anything else.)  

As part of the work on name lookup I have been doing,  I noticed that
those are really declared as names in binding contours -- which does
serve no purpose.

| The keywords are _Complex (C99), __complex (traditional GNU) and
| __complex__ (traditional GNU) and "complex" is a macro in <complex.h>
| only.
| 
| Some of the types with spaces in are defined for C++ only ("unsigned long"  
| as opposed to "long unsigned int", ...) - again, I suppose these
| definitions may be for debug info, as they aren't related to source
| parsing

C++ definition says that they are fondamental type specifiers.

| - but I don't know whether in fact they should be C++-only: those
| conditionals simply reflect merging similar but nonidentical code defining
| built-in types in the C and C++ front ends.

That may be so.  Except that for "complex type", it is bogus.

-- Gaby



More information about the Gcc mailing list