This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c/7622
Philippe Trebuchet <Philippe.Trebuchet@sophia.inria.fr> writes:
| Gabriel Dos Reis wrote:
| >
| > Philippe Trebuchet <Philippe.Trebuchet@sophia.inria.fr> writes:
| >
| > | Gabriel Dos Reis wrote:
| > | >
| > | > Eric Botcazou <ebotcazou@libertysurf.fr> writes:
| > | >
| > | > | The faulty definition of the nested bar() should be flagged earlier during
| > | > | parsing I think (see c-decl.c:finish_decl).
| > |
| > | I think it cannot be flagged by that time because it is just a forward
| > | nested declare I beleive that genrtl_scope_stmt is the right time to
| > | check everything is in place.
| >
| > Since we're in function-at-a-time mode, after the definition of the
| > enclosing function, one has enought information to diagnose that
| > ill-formed construct.
| >
|
| Yes, isn't that moment handled in genrtl_scope_stmt?
No. Forget about RTL.
A natural place to do some C langugage level processing when a
function definition is finished is either finish_decl or
finish_function. Choisis ton camp, camarade.
In a not so distant future (as the front-end is improveing), the
front-end will parse, transform at tree level, hands off to the
tree->RTL translator. If you're going to fix a C language level bug,
please don't mess with RTL generation.
| > [...]
| >
| > | By the way what do you think about adding a warning
| > | saying that gcc just forget the definition in
| > | toplev.c:rest_of_compilation instead. do you think it is a good idea?
| >
| > Please, DON'T do that.
|
| why?
Because it isn't doing any good.
| > | > | name than the original one, by using the "alias" attribute. But, as Richard
| > | > | pointed out, the "alias" attribute is a definition, not a declaration. So we
| > | > | should again flag the error earlier.
| > | >
| > | > 100% agreed.
| > | >
| > |
| > | I understand this point, but as there is no mangement of asm symbols it
| >
| > Seeing whether a nested function is missing a definition requires no
| > asm symbol management.
|
| right, here I was speaking about alias symbol who are asm symbols sorry
| for not beeing clear
Please, keep distinct topics in distinct thread to help the
discussion.
-- Gaby