public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] rename flag_size_check to flag_allow_nonconst_size and make it a bool
@ 2016-03-25 19:46 tbsaunde+binutils
  2016-03-25 21:23 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: tbsaunde+binutils @ 2016-03-25 19:46 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

Hi,

This name describes what the variable means slightly better, and the enum with
two values that is only used for this one variable is kind of silly.

built and regtested on x86_64-linux-gnu, ok?

Trev

gas/ChangeLog:

2016-03-25  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* as.c (parse_args): Adjust.
	* as.h (flag_size_check): Rename to flag_allow_nonconst_size.
	* config/obj-elf.c (elf_frob_symbol): Adjust.
---
 gas/as.c             | 4 ++--
 gas/as.h             | 7 +------
 gas/config/obj-elf.c | 2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/gas/as.c b/gas/as.c
index 14980b9..ad3d3a6 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -870,9 +870,9 @@ This program has absolutely no warranty.\n"));
 
 	case OPTION_SIZE_CHECK:
 	  if (strcasecmp (optarg, "error") == 0)
-	    flag_size_check = size_check_error;
+	    flag_allow_nonconst_size = FALSE;
 	  else if (strcasecmp (optarg, "warning") == 0)
-	    flag_size_check = size_check_warning;
+	    flag_allow_nonconst_size = TRUE;
 	  else
 	    as_fatal (_("Invalid --size-check= option: `%s'"), optarg);
 	  break;
diff --git a/gas/as.h b/gas/as.h
index 4e5601b..ba2fb7d 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -585,12 +585,7 @@ COMMON const char *        found_comment_file;
 
 #if defined OBJ_ELF || defined OBJ_MAYBE_ELF
 /* If .size directive failure should be error or warning.  */
-COMMON enum
-  {
-    size_check_error = 0,
-    size_check_warning
-  }
-flag_size_check;
+COMMON int flag_allow_nonconst_size;
 
 /* If we should generate ELF common symbols with the STT_COMMON type.  */
 extern int flag_use_elf_stt_common;
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index bacaca3..c7a4ee4 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2165,7 +2165,7 @@ elf_frob_symbol (symbolS *symp, int *puntp)
 	S_SET_SIZE (symp, size->X_add_number);
       else
 	{
-	  if (flag_size_check == size_check_error)
+	  if (!flag_allow_nonconst_size)
 	    as_bad (_(".size expression for %s "
 		      "does not evaluate to a constant"), S_GET_NAME (symp));
 	  else
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rename flag_size_check to flag_allow_nonconst_size and make it a bool
  2016-03-25 19:46 [PATCH] rename flag_size_check to flag_allow_nonconst_size and make it a bool tbsaunde+binutils
@ 2016-03-25 21:23 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2016-03-25 21:23 UTC (permalink / raw)
  To: tbsaunde+binutils; +Cc: binutils

On Fri, Mar 25, 2016 at 03:51:45PM -0400, tbsaunde+binutils@tbsaunde.org wrote:
> 	* as.c (parse_args): Adjust.
> 	* as.h (flag_size_check): Rename to flag_allow_nonconst_size.
> 	* config/obj-elf.c (elf_frob_symbol): Adjust.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-25 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-25 19:46 [PATCH] rename flag_size_check to flag_allow_nonconst_size and make it a bool tbsaunde+binutils
2016-03-25 21:23 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).