This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
arm deprecated assembler warnings
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 23 Jan 2009 16:49:12 +0000
- Subject: arm deprecated assembler warnings
This patch implements -m[no-]warn-deprecated for the arm assembler, thus giving
you control over whether you get such warnings. The default is to warn, just as
before.
tested on arm-elf, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2009-01-23 Nathan Sidwell <nathan@codesourcery.com>
* doc/c-arm.texi (): Document -mwarn-deprecated.
* config/tc-arm.c (WARN_DEPRECATED): Remove. Replace with ...
(warn_on_deprecated): ... this.
(opcode_lookup, md_assemble): Check it before warning.
(arm_opts): Add m[no-]warn-deprecated.
(md_parse_option): Replace WARN_DEPRECATED with
warn_on_deprecated.
Index: config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.367
diff -c -3 -p -r1.367 tc-arm.c
*** config/tc-arm.c 19 Jan 2009 15:46:31 -0000 1.367
--- config/tc-arm.c 23 Jan 2009 16:32:50 -0000
***************
*** 42,49 ****
#include "dwarf2dbg.h"
- #define WARN_DEPRECATED 1
-
#ifdef OBJ_ELF
/* Must be at least the size of the largest unwind opcode (currently two). */
#define ARM_OPCODE_CHUNK_SIZE 8
--- 42,47 ----
*************** static int support_interwork = FALSE;
*** 144,149 ****
--- 142,150 ----
static int uses_apcs_float = FALSE;
static int pic_code = FALSE;
static int fix_v4bx = FALSE;
+ /* Warn on using deprecated features. */
+ static int warn_on_deprecated = TRUE;
+
/* Variables that we set while parsing command-line options. Once all
options have been read we re-process these values to set the real
*************** opcode_lookup (char **str)
*** 14162,14168 ****
return opcode;
}
! if (unified_syntax)
as_warn (_("conditional infixes are deprecated in unified syntax"));
affix = base + (opcode->tag - OT_odd_infix_0);
cond = hash_find_n (arm_cond_hsh, affix, 2);
--- 14163,14169 ----
return opcode;
}
! if (warn_on_deprecated && unified_syntax)
as_warn (_("conditional infixes are deprecated in unified syntax"));
affix = base + (opcode->tag - OT_odd_infix_0);
cond = hash_find_n (arm_cond_hsh, affix, 2);
*************** opcode_lookup (char **str)
*** 14246,14252 ****
|| opcode->tag == OT_cinfix3_legacy))
{
/* step CM */
! if (unified_syntax
&& (opcode->tag == OT_cinfix3
|| opcode->tag == OT_cinfix3_deprecated))
as_warn (_("conditional infixes are deprecated in unified syntax"));
--- 14247,14253 ----
|| opcode->tag == OT_cinfix3_legacy))
{
/* step CM */
! if (warn_on_deprecated && unified_syntax
&& (opcode->tag == OT_cinfix3
|| opcode->tag == OT_cinfix3_deprecated))
as_warn (_("conditional infixes are deprecated in unified syntax"));
*************** md_assemble (char *str)
*** 14287,14293 ****
return;
}
! if (opcode->tag == OT_cinfix3_deprecated)
as_warn (_("s suffix on comparison instruction is deprecated"));
/* The value which unconditional instructions should have in place of the
--- 14288,14294 ----
return;
}
! if (warn_on_deprecated && opcode->tag == OT_cinfix3_deprecated)
as_warn (_("s suffix on comparison instruction is deprecated"));
/* The value which unconditional instructions should have in place of the
*************** md_begin (void)
*** 19902,19907 ****
--- 19903,19910 ----
-mthumb Start in Thumb mode
-mthumb-interwork Code supports ARM/Thumb interworking
+ -m[no-]warn-deprecated Warn about deprecated features
+
For now we will also provide support for:
-mapcs-32 32-bit Program counter
*************** struct arm_option_table arm_opts[] =
*** 19999,20004 ****
--- 20002,20011 ----
/* These are recognized by the assembler, but have no affect on code. */
{"mapcs-frame", N_("use frame pointer"), NULL, 0, NULL},
{"mapcs-stack-check", N_("use stack size checking"), NULL, 0, NULL},
+
+ {"mwarn-deprecated", NULL, &warn_on_deprecated, 1, NULL},
+ {"mno-warn-deprecated", N_("do not warn on use of deprecated feature"),
+ &warn_on_deprecated, 0, NULL},
{NULL, NULL, NULL, 0, NULL}
};
*************** md_parse_option (int c, char * arg)
*** 20610,20621 ****
&& ((arg == NULL && opt->option[1] == 0)
|| streq (arg, opt->option + 1)))
{
- #if WARN_DEPRECATED
/* If the option is deprecated, tell the user. */
! if (opt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c,
arg ? arg : "", _(opt->deprecated));
- #endif
if (opt->var != NULL)
*opt->var = opt->value;
--- 20617,20626 ----
&& ((arg == NULL && opt->option[1] == 0)
|| streq (arg, opt->option + 1)))
{
/* If the option is deprecated, tell the user. */
! if (warn_on_deprecated && opt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c,
arg ? arg : "", _(opt->deprecated));
if (opt->var != NULL)
*opt->var = opt->value;
*************** md_parse_option (int c, char * arg)
*** 20630,20641 ****
&& ((arg == NULL && fopt->option[1] == 0)
|| streq (arg, fopt->option + 1)))
{
- #if WARN_DEPRECATED
/* If the option is deprecated, tell the user. */
! if (fopt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c,
arg ? arg : "", _(fopt->deprecated));
- #endif
if (fopt->var != NULL)
*fopt->var = &fopt->value;
--- 20635,20644 ----
&& ((arg == NULL && fopt->option[1] == 0)
|| streq (arg, fopt->option + 1)))
{
/* If the option is deprecated, tell the user. */
! if (warn_on_deprecated && fopt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c,
arg ? arg : "", _(fopt->deprecated));
if (fopt->var != NULL)
*fopt->var = &fopt->value;
*************** md_parse_option (int c, char * arg)
*** 20652,20663 ****
&& strncmp (arg, lopt->option + 1,
strlen (lopt->option + 1)) == 0)
{
- #if WARN_DEPRECATED
/* If the option is deprecated, tell the user. */
! if (lopt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, arg,
_(lopt->deprecated));
- #endif
/* Call the sup-option parser. */
return lopt->func (arg + strlen (lopt->option) - 1);
--- 20655,20664 ----
&& strncmp (arg, lopt->option + 1,
strlen (lopt->option + 1)) == 0)
{
/* If the option is deprecated, tell the user. */
! if (warn_on_deprecated && lopt->deprecated != NULL)
as_tsktsk (_("option `-%c%s' is deprecated: %s"), c, arg,
_(lopt->deprecated));
/* Call the sup-option parser. */
return lopt->func (arg + strlen (lopt->option) - 1);
Index: doc/c-arm.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/c-arm.texi,v
retrieving revision 1.53
diff -c -3 -p -r1.53 c-arm.texi
*** doc/c-arm.texi 16 Jan 2009 10:26:48 -0000 1.53
--- doc/c-arm.texi 23 Jan 2009 16:32:51 -0000
*************** as position-independent code (PIC).
*** 291,296 ****
--- 291,302 ----
Allow @code{BX} instructions in ARMv4 code. This is intended for use with
the linker option of the same name.
+ @cindex @code{-mwarn-deprecated} command line option, ARM
+ @item -mwarn-deprecated
+ @itemx -mno-warn-deprecated
+ Enable or disable warnings about using deprecated options or
+ features. The default is to warn.
+
@end table