daily update
[deliverable/binutils-gdb.git] / gas / messages.c
index a8e309d1622cf2a9977327a362f92a1a3347ff7a..c8788dcc32d5eb5ff517fef201cb1a41f04811b1 100644 (file)
@@ -1,6 +1,6 @@
 /* messages.c - error reporter -
    Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
-   2003, 2004, 2005
+   2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of GAS, the GNU Assembler.
 
 
 #include "as.h"
 
-#include <stdio.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef USE_STDARG
-#include <stdarg.h>
-#endif
-
-#ifdef USE_VARARGS
-#include <varargs.h>
-#endif
-
-#if !defined (USE_STDARG) && !defined (USE_VARARGS)
-/* Roll our own.  */
-#define va_alist REST
-#define va_dcl
-typedef int * va_list;
-#define va_start(ARGS) ARGS = &REST
-#define va_end(ARGS)
-#endif
-
 static void identify (char *);
 static void as_show_where (void);
 static void as_warn_internal (char *, unsigned int, char *);
@@ -138,24 +116,6 @@ as_show_where (void)
     fprintf (stderr, "%s:%u: ", file, line);
 }
 
-/* Like perror(3), but with more info.  */
-
-void
-as_perror (const char *gripe,          /* Unpunctuated error theme.  */
-          const char *filename)
-{
-  const char *errtxt;
-  int saved_errno = errno;
-
-  as_show_where ();
-  fprintf (stderr, gripe, filename);
-  errno = saved_errno;
-  errtxt = bfd_errmsg (bfd_get_error ());
-  fprintf (stderr, ": %s\n", errtxt);
-  errno = 0;
-  bfd_set_error (bfd_error_no_error);
-}
-
 /* Send to stderr a string as a warning, and locate warning
    in input file(s).
    Please only use this for when we have some recovery action.
@@ -496,6 +456,24 @@ as_internal_value_out_of_range (char *    prefix,
   if (prefix == NULL)
     prefix = "";
 
+  if (val >= min && val <= max)
+    {
+      addressT right = max & -max;
+
+      if (max <= 1)
+       abort ();
+
+      /* xgettext:c-format  */
+      err = _("%s out of domain (%d is not a multiple of %d)");
+      if (bad)
+       as_bad_where (file, line, err,
+                     prefix, (int) val, (int) right);
+      else
+       as_warn_where (file, line, err,
+                      prefix, (int) val, (int) right);
+      return;
+    }
+
   if (   val < HEX_MAX_THRESHOLD
       && min < HEX_MAX_THRESHOLD
       && max < HEX_MAX_THRESHOLD
This page took 0.032487 seconds and 4 git commands to generate.