> On May 25, 2023, at 5:02 PM, Joseph Myers <jos...@codesourcery.com> wrote: > > 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. Will check on this and add testing case for this case. > > 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.
Dump question: how to check whether the string is a wide string? -:) > > 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. Okay, will check on this and add test case. > > 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. Yes, that’s right, will add this. Thanks a lot. Qing > > -- > Joseph S. Myers > jos...@codesourcery.com