This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug in C front-end?
- To: gcc at gcc dot gnu dot org
- Subject: Bug in C front-end?
- From: Jim Little <jiml at inconnect dot com>
- Date: Sun, 19 Mar 2000 12:01:22 -0700
I'm working on converting the gcc 2.95.2 C front-end into a stand-alone
C parser. I've come across something that seems like it might be a bug,
but it's so basic that my first thought is that I'm missing something
obvious. Here's the situation:
Given this program as input:
const int * const foo() {}
gcc defines this tree node as the function's return type (output
courtesy of debug_tree):
<pointer_type 0x829ad84
type <integer_type 0x828fa30 int allocated from permanent_obstack
permanent SI
size <integer_cst 0x828fc10 constant permanent 32>
align 32 symtab 0 alias set -1 precision 32
min <integer_cst 0x828fa90 constant permanent -2147483648>
max <integer_cst 0x828faa8 constant permanent 2147483647>
pointer_to_this <pointer_type 0x8295e2c>>
allocated from permanent_obstack
readonly unsigned permanent SI size <integer_cst 0x828fc10 32>
align 32 symtab 0 alias set -1>
Note that the pointer_type node has a readonly flag but that the
integer_type node does not. Why not?
Thanks,
Jim Little
--
The Prism project for simple, interoperable metaprograms.
http://www.prism.cx