From bbbd670050382b8998c4b639e8cc0ed61686487d Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 21 Sep 1994 14:45:25 -0400 Subject: (mark_addressable): Give different error if trying to put object with volatile fields into register... (mark_addressable): Give different error if trying to put object with volatile fields into register; don't use DECL_NAME. From-SVN: r8115 --- gcc/c-typeck.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc') diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d09399b..b3b3682 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3223,6 +3223,18 @@ mark_addressable (exp) IDENTIFIER_POINTER (DECL_NAME (x))); return 0; } + + /* If we are making this addressable due to its having + volatile components, give a different error message. Also + handle the case of an unnamed parameter by not trying + to give the name. */ + + else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x))) + { + error ("cannot put object with volatile field into register"); + return 0; + } + pedwarn ("address of register variable `%s' requested", IDENTIFIER_POINTER (DECL_NAME (x))); } -- cgit v1.1