pspp-users
[Top][All Lists]
Advanced

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

Re: Warnings exceed limit


From: Ben Pfaff
Subject: Re: Warnings exceed limit
Date: Sat, 16 Nov 2019 11:14:27 -0800

On Sat, Nov 16, 2019 at 10:40 AM Alan Mead <address@hidden> wrote:
>
> 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?

I'm sure it's because I read in some earlier version of the SPSS
documentation that errors contribute toward the warning count for this
purpose. It looks like this is no longer the case though.

> 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.

There's no simple way for this code called deep within PSPP to just
abandon ship and jump out, so it is handled at a higher level.

Recent SPSS documentation specifies two ways that exceeding MXWARNS
can be handled. In batch mode, it does what PSPP does here, stopping
processing if MXWARNS is exceeded. In interactive mode, it just
suppresses warnings beyond the warning limit. This distinction between
modes is IMO a nasty aspect of SPSS behavior and I'm never really sure
which behavior to implement in PSPP when it differs.



reply via email to

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