braces around scalar initializer

Joaquin Ferruz Melero ferruz@cartuja.us.es
Wed Dec 11 03:00:00 GMT 2002



David Cullen wrote:

> Why doesn't this work:
>
> Rectangle *cherry[]    = { { 10, 10, 100, 100 }, NULL };
>
> Display.c:137: warning: braces around scalar initializer
> Display.c:137: warning: (near initialization for `cherry[0]')
>
> May God bless you,
> David Cullen

        The compiler is expecting a list of pointers (scalars), because
"cherry" is an array of pointers, not an array of  "Rectangle"s. You can
only use embedded braces for members which are agregates themselves.

         Regards,

                                     Joaquín Ferruz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ferruz.vcf
Type: text/x-vcard
Size: 317 bytes
Desc: Card for Joaquin Ferruz Melero
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20021211/91afab40/attachment-0001.vcf>


More information about the Gcc-help mailing list