Changeset 3920 for branches/libc-0.6


Ignore:
Timestamp:
Oct 25, 2014, 7:11:49 PM (11 years ago)
Author:
bird
Message:

trunk,0.6: Reduce stabs -> hll conversion warnings to a single warning per file by default, use new '-v' option to get all warnings and '-q' to shut them up completely.

Location:
branches/libc-0.6/src/emx/src/emxomf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/src/emxomf/emxomf.c

    r3919 r3920  
    197197   of the input file or a library name plus module name:
    198198   library(module). */
    199 static const char *error_fname;
     199const char *error_fname;
    200200
    201201/* The output directory.  This is set by the -O option. */
     
    405405static int unknown_stabs = FALSE;
    406406
    407 /* Supress certain warnings if this variable is TRUE (-q option). */
    408 static int quiet = FALSE;
     407/* Warning level (-q & -v options). */
     408int warning_level = 1;
    409409
    410410/* The libreq_head variable contains a pointer to the head of the list
     
    603603        {
    604604          s_pszComplainedFor = error_fname;
    605           warning ("Input file '%s' has more HLL debug types than we can index in PUBDEF and EXTDEF records.", error_fname);
     605          if (warning_level >= 1)
     606            warning("Input file '%s' has more HLL debug types than we can index in PUBDEF and EXTDEF records.",
     607                    error_fname);
    606608        }
    607609      hll_type = 0;
     
    18461848            {
    18471849              ok = FALSE;
    1848               if (!quiet)
     1850              if (warning_level > 0)
    18491851                warning ("Internal PC-relative relocation ignored");
    18501852            }
     
    42404242        break;
    42414243      case 'q':
    4242         quiet = TRUE;
     4244        warning_level--;
    42434245        break;
    42444246      case 'O':
     
    42604262        unknown_stabs = TRUE;
    42614263        break;
     4264      case 'v':
     4265        warning_level++;
     4266        break;
    42624267      case 'x':
    42634268        opt_x = TRUE;
  • branches/libc-0.6/src/emx/src/emxomf/emxomf.h

    r806 r3920  
    4949extern int *tt_boundary;
    5050extern int hll_version;
     51extern const char *error_fname;
     52extern int warning_level;
  • branches/libc-0.6/src/emx/src/emxomf/stabshll.c

    r3067 r3920  
    403403  va_list args;
    404404
    405   va_start (args, pszFormat);
    406   fprintf (stderr, "emxomf warning: ");
    407   vfprintf (stderr, pszFormat, args);
    408   va_end (args);
    409   fputc ('\n', stderr);
    410 
    411 
    412   if (parse_ptr && parse_start && parse_ptr >= parse_start)
    413     {
    414       if (parse_pindex && *parse_pindex >= 0 && *parse_pindex < sym_count)
    415         fprintf (stderr, "emxomf info: parsing sym no.%d type=%d at char '%c' in position %d:\n%s\n",
    416                  *parse_pindex, sym_ptr[*parse_pindex].n_type,
    417                  *parse_ptr, parse_ptr - parse_start, parse_start);
    418       else
    419         fprintf (stderr, "emxomf info: parsing '%c' at position %d:\n%s\n",
    420                  *parse_ptr, parse_ptr - parse_start, parse_start);
     405  if (warning_level < 2)
     406    {
     407      static const char *s_pszComplainedFor = NULL;
     408      if (warning_level == 1 && s_pszComplainedFor == error_fname)
     409        {
     410          s_pszComplainedFor = error_fname;
     411          fprintf (stderr, "emxomf warning: debug info conversion issues for '%s'. (-v for details.)\n", error_fname);
     412        }
     413    }
     414  else
     415    {
     416      va_start(args, pszFormat);
     417      fprintf (stderr, "emxomf warning: ");
     418      vfprintf (stderr, pszFormat, args);
     419      va_end (args);
     420      fputc ('\n', stderr);
     421
     422      if (parse_ptr && parse_start && parse_ptr >= parse_start)
     423        {
     424          if (parse_pindex && *parse_pindex >= 0 && *parse_pindex < sym_count)
     425            fprintf (stderr, "emxomf info: parsing sym no.%d type=%d at char '%c' in position %d:\n%s\n",
     426                     *parse_pindex, sym_ptr[*parse_pindex].n_type,
     427                     *parse_ptr, parse_ptr - parse_start, parse_start);
     428          else
     429            fprintf (stderr, "emxomf info: parsing '%c' at position %d:\n%s\n",
     430                     *parse_ptr, parse_ptr - parse_start, parse_start);
     431        }
    421432    }
    422433}
Note: See TracChangeset for help on using the changeset viewer.