From: Richard Kenner Date: Sun, 24 Dec 1995 23:15:12 +0000 (-0500) Subject: (mark_addressable, case COMPONENT_REF): Give error if taking address X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1598f4da785010db4282a0f502eb2bfc5a9839e1;p=gcc.git (mark_addressable, case COMPONENT_REF): Give error if taking address of a bit field. From-SVN: r10858 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d76e724861c..d8e4ff1e316 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3292,8 +3292,15 @@ mark_addressable (exp) while (1) switch (TREE_CODE (x)) { - case ADDR_EXPR: case COMPONENT_REF: + if (DECL_C_BIT_FIELD (TREE_OPERAND (x, 1))) + error ("cannot take address of bitfield `%s'", + IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1)))); + return 0; + + /* ... fall through ... */ + + case ADDR_EXPR: case ARRAY_REF: case REALPART_EXPR: case IMAGPART_EXPR: