https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79883

Frederic Marchal <fmarchal at perso dot be> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fmarchal at perso dot be

--- Comment #3 from Frederic Marchal <fmarchal at perso dot be> ---
I confirm this is a problem at two more places within the same
avr_set_current_function() function:

  if (args && TREE_CODE (TREE_VALUE (args)) != VOID_TYPE)
    error_at (loc, "%qs function cannot have arguments", isr);

  if (TREE_CODE (ret) != VOID_TYPE)
    error_at (loc, "%qs function cannot return a value", isr);

I had to degrade the French translation to accommodate the %qs. The correct
translation for "interrupt function" should have been "la fonction
d'interruption" but it is, instead, the ugly "la fonction avec l'attribut «
interrupt »".

Similarly, "signal function" should be "la fonction de traitement du signal"
instead of the silly looking "la fonction avec l'attribut « signal »".

The keyword idiom is correct in this instance though:

  error_at (loc, "function attributes %qs, %qs and %qs are mutually"
            " exclusive", "OS_task", "OS_main", isr);

Therefore, I suggest to replace the above two messages with

  if (args && TREE_CODE (TREE_VALUE (args)) != VOID_TYPE) {
    if (cfun->machine->is_interrupt)
       error_at (loc, "%<interrupt%> function cannot have arguments");
    else
       error_at (loc, "%<signal%> function cannot have arguments");
  }

  if (TREE_CODE (ret) != VOID_TYPE) {
    if (cfun->machine->is_interrupt)
       error_at (loc, "%<interrupt%> function cannot return a value");
    else
       error_at (loc, "%<signal%> function cannot return a value");
  }

And the one reported by Roland with

  if (!STR_PREFIX_P (name, "__vector")) {
    if (cfun->machine->is_interrupt)
       warning_at (loc, OPT_Wmisspelled_isr, "%qs appears to be a misspelled "
                  "interrupt handler, missing __vector prefix", name);
    else
       warning_at (loc, OPT_Wmisspelled_isr, "%qs appears to be a misspelled "
                  "signal handler, missing __vector prefix", name);
  }

Reply via email to