What happens if the field giving the number of elements is in a contained anonymous structure or union?
struct s { struct { size_t count; }; int array[] __attribute__ ((element_count ("count"))); }; This ought to work - a general principle in C is that anonymous structures and unions are transparent as far as name lookup for fields is concerned. But I don't see any testcases for it and I'm not sure it would work with the present code. What if the string is a wide string? I don't expect that to work (either as a matter of interface design, or in the present code), but I think that case should have a specific check and error. What happens in the case where -fexec-charset specifies a non-ASCII-compatible character set? I expect that to work OK with the existing code, because translation of string literals to the execution character set is disabled in __attribute__ parsing, but having a testcase for it would be good. What happens if the field referenced for the element count does not have integer type? I'd expect an error, but don't see one in the code or tests here. -- Joseph S. Myers jos...@codesourcery.com