pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warnings exceed limit


From: Alan Mead
Subject: Re: Warnings exceed limit
Date: Sat, 16 Nov 2019 12:40:34 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 11/16/2019 11:31 AM, Frans Houweling wrote:
> Yes, but for errors we have MXERRS. I personally would like PSPP to
> halt on the first error, but never on a warning.
> Greetings
> frans

Sorry, that was my point. It's really unhelpful to stop on warnings (of
any number). MXWARNS is helpful to stop reporting.

So, that message about stopping syntax processing only seems to appear
in in src/libpspp/message.c:

[amead@cow3 pspp-1.2.0]$ grep -r 'Syntax processing will be halt' src/*
src/libpspp/message.c:            submit_note (xasprintf (_("Warnings
(%d) exceed limit (%d).  Syntax processing will be halted."),
src/libpspp/message.c:            submit_note (xasprintf (_("Errors (%d)
exceed limit (%d).  Syntax processing will be halted."),

That's in prcess_msg(), and the function is pretty simple:

static void
process_msg (struct msg *m)
{
  int n_msgs, max_msgs;

  if (too_many_errors
      || (too_many_notes && m->severity == MSG_S_NOTE)
      || (warnings_off && m->severity == MSG_S_WARNING) )
    return;

  ship_message (m);

  counts[m->severity]++;
  max_msgs = settings_get_max_messages (m->severity);
  n_msgs = counts[m->severity];
  if (m->severity == MSG_S_WARNING)
    n_msgs += counts[MSG_S_ERROR];
  if (n_msgs > max_msgs)
    {
      if (m->severity == MSG_S_NOTE)
        {
          too_many_notes = true;
          submit_note (xasprintf (_("Notes (%d) exceed limit (%d).  "
                                    "Suppressing further notes."),
                                  n_msgs, max_msgs));
        }
      else
        {
          too_many_errors = true;
          if (m->severity == MSG_S_WARNING)
            submit_note (xasprintf (_("Warnings (%d) exceed limit (%d). 
Syntax processing will be halted."),
                                    n_msgs, max_msgs));
          else
            submit_note (xasprintf (_("Errors (%d) exceed limit (%d). 
Syntax processing will be halted."),
                                    n_msgs, max_msgs));
        }
    }
}


I don't understand this code:
>   if (m->severity == MSG_S_WARNING)
>     n_msgs += counts[MSG_S_ERROR];

Why would a warning increase n_msgs by some count of errors?

Also, if warnings and errors are handled differently, there should be
some parallel but independent handling of errors and warnings. The large
IF statement at the end of the function is basically doing the same
thing regardless of the type (warning or error; it's only
differentiating between error and warning for the purposes of displaying
the correct "type" in the log message). So, that means the code treats
warnings and errors in an identical way (although you can turn off
warnings). There are booleans too_many_errors and too_many_notes, I
think there should be a too_many_warnings boolean that tracks and
suppresses warnings independently? (It looks like there's a warnings_off
boolean that simply skips all this; but Frans notes this functionality
is not the same.)

This code doesn't seem to actually stop processing. I'd guess elsewhere
there's a check during processing; so maybe there is additional
complexity to this issue.

-Alan

-- 

Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.

science + technology = better workers

http://www.alanmead.org

"A human being should be able to change a diaper, plan an
invasion, butcher a hog, conn a ship, design a building,
write a sonnet, balance accounts, build a wall, set a bone,
comfort the dying, take orders, give orders, cooperate,
act alone, solve equations, analyze a new problem, pitch
manure, program a computer, cook a tasty meal, fight
efficiently, and die gallantly. Specialization is for 
insects."

-- Robert A. Heinlein



reply via email to

[Prev in Thread] Current Thread [Next in Thread]