Skip to content

[clang on Wine]: constant integer size rejected as not being constant #4041

@tkremenek

Description

@tkremenek
Bugzilla Link 3669
Resolution DUPLICATE
Resolved on Mar 12, 2010 00:57
Version unspecified
OS All
CC @efriedma-quic

Extended Description

The following self-contained code example (reduced from a case in Wine) is rejected by Clang because the size of the array is deemed not a constant:

typedef unsigned long UINT_PTR, *PUINT_PTR;
typedef struct HHOOK__ {} *HKEY;
static HKEY special_root_keys[((UINT_PTR)((HKEY) 0x80000006) - (UINT_PTR)((HKEY) 0x80000000) + 1)];

The error emitted by clang:

t.c:3:13: error: variable length array declaration not allowed at file scope
static HKEY special_root_keys[((UINT_PTR)((HKEY) 0x80000006) - (UINT_PTR)((HKEY) 0x80000000) + 1)];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 diagnostic generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions