unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale
@ 2024-05-07 17:06 Paul Eggert
  2024-05-08 13:05 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2024-05-07 17:06 UTC (permalink / raw)
  To: 70822

In the en_US.UTF-8 locale on Fedora 40, (GCC) 14.0.1 20240411 (Red Hat 
14.0.1-0) uses curved single quotes ‘like this’. This causes Emacs ‘make 
check’ to fail in the flymake tests.

For example, in the C locale 'gcc 
test/lisp/progmodes/flymake-resources/some-problems.h' outputs this:

   test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
data definition has no type or storage class
       3 | strange;
         | ^~~~~~~
   test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
type defaults to 'int' in declaration of 'strange' [-Wimplicit-int]
   test/lisp/progmodes/flymake-resources/some-problems.h:7:1: error: 
unknown type name 'sint'; did you mean 'int'?
       7 | sint main();
         | ^~~~
         | int

whereas in the en_US.UTF-8 locale the same command outputs this instead:

   test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
data definition has no type or storage class
       3 | strange;
         | ^~~~~~~
   test/lisp/progmodes/flymake-resources/some-problems.h:3:1: error: 
type defaults to ‘int’ in declaration of ‘strange’ [-Wimplicit-int]
   test/lisp/progmodes/flymake-resources/some-problems.h:7:1: error: 
unknown type name ‘sint’; did you mean ‘int’?
       7 | sint main();
         | ^~~~
         | int

and flymake mishandles the latter set of diagnostics.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale
  2024-05-07 17:06 bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale Paul Eggert
@ 2024-05-08 13:05 ` Eli Zaretskii
  2024-05-08 17:10   ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-08 13:05 UTC (permalink / raw)
  To: Paul Eggert, Spencer Baugh; +Cc: 70822

> Date: Tue, 7 May 2024 10:06:59 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> In the en_US.UTF-8 locale on Fedora 40, (GCC) 14.0.1 20240411 (Red Hat 
> 14.0.1-0) uses curved single quotes ‘like this’. This causes Emacs ‘make 
> check’ to fail in the flymake tests.
> 
> For example, in the C locale 'gcc 
> test/lisp/progmodes/flymake-resources/some-problems.h' outputs this:
> 
>    test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
> data definition has no type or storage class
>        3 | strange;
>          | ^~~~~~~
>    test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
> type defaults to 'int' in declaration of 'strange' [-Wimplicit-int]
>    test/lisp/progmodes/flymake-resources/some-problems.h:7:1: error: 
> unknown type name 'sint'; did you mean 'int'?
>        7 | sint main();
>          | ^~~~
>          | int
> 
> whereas in the en_US.UTF-8 locale the same command outputs this instead:
> 
>    test/lisp/progmodes/flymake-resources/some-problems.h:3:1: warning: 
> data definition has no type or storage class
>        3 | strange;
>          | ^~~~~~~
>    test/lisp/progmodes/flymake-resources/some-problems.h:3:1: error: 
> type defaults to ‘int’ in declaration of ‘strange’ [-Wimplicit-int]
>    test/lisp/progmodes/flymake-resources/some-problems.h:7:1: error: 
> unknown type name ‘sint’; did you mean ‘int’?
>        7 | sint main();
>          | ^~~~
>          | int
> 
> and flymake mishandles the latter set of diagnostics.

AFAICT, flymake-tests.el injects LC_ALL=C into process-environment (in
flymake-tests--call-with-fixture called from
flymake-tests--with-flymake), so why doesn't that affect the locale
under which the test runs?

And could you perhaps show the error message reported by the failing
test(s) in that case?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale
  2024-05-08 13:05 ` Eli Zaretskii
@ 2024-05-08 17:10   ` Paul Eggert
  2024-05-08 18:38     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2024-05-08 17:10 UTC (permalink / raw)
  To: Eli Zaretskii, Spencer Baugh; +Cc: 70822

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

> AFAICT, flymake-tests.el injects LC_ALL=C into process-environment (in
> flymake-tests--call-with-fixture called from
> flymake-tests--with-flymake), so why doesn't that affect the locale
> under which the test runs?

I don't know. But shouldn't flymake also work when LC_ALL='en_US.UTF-8'? 
That is, instead of trying (but evidently failing) to check only 
LC_ALL='C', shouldn't flymake-tests also check the LC_ALL='en_US.UTF-8' 
case?


> And could you perhaps show the error message reported by the failing
> test(s) in that case?

The contents of test/lisp/progmodes/flymake-tests.log are attached.

[-- Attachment #2: flymake-tests.log --]
[-- Type: text/x-log, Size: 2054 bytes --]

Running 9 tests (2024-05-08 10:01:37-0700, selector `(not (or (tag :expensive-test) (tag :unstable)))')
   passed  1/9  different-diagnostic-types (1.151769 sec)
   passed  2/9  dummy-backends (1.002037 sec)
   passed  3/9  eob-region-and-trailing-newline (0.000190 sec)
Test included-c-header-files backtrace:
  signal(ert-test-failed (((should (eq 'flymake-warning (face-at-point
  ert-fail(((should (eq 'flymake-warning (face-at-point))) :form (eq f
  #f(compiled-function () #<bytecode 0x1bee812822f86a40>)()
  flymake-tests--call-with-fixture(#f(compiled-function () #<bytecode 
  #f(compiled-function () #<bytecode -0x1170404b2f5c8feb>)()
  #f(compiled-function () #<bytecode 0x899bb4b220fad07>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x899bb4b220fad07>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name included-c-header-files :documentatio
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
  command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
  command-line()
  normal-top-level()
Test included-c-header-files condition:
    (ert-test-failed
     ((should (eq 'flymake-warning (face-at-point))) :form
      (eq flymake-warning flymake-error) :value nil))
   FAILED  4/9  included-c-header-files (1.045034 sec) at lisp/progmodes/flymake-tests.el:168
   passed  5/9  perl-backend (1.034836 sec)
   passed  6/9  recurrent-backend (1.004512 sec)
   passed  7/9  ruby-backend (1.076380 sec)
   passed  8/9  warning-predicate-function-gcc (1.088740 sec)
   passed  9/9  warning-predicate-rx-gcc (1.071722 sec)

Ran 9 tests, 8 results as expected, 1 unexpected (2024-05-08 10:01:46-0700, 8.595761 sec)

1 unexpected results:
   FAILED  included-c-header-files


^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale
  2024-05-08 17:10   ` Paul Eggert
@ 2024-05-08 18:38     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-08 18:38 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 70822, sbaugh

> Date: Wed, 8 May 2024 10:10:00 -0700
> Cc: 70822@debbugs.gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> > AFAICT, flymake-tests.el injects LC_ALL=C into process-environment (in
> > flymake-tests--call-with-fixture called from
> > flymake-tests--with-flymake), so why doesn't that affect the locale
> > under which the test runs?
> 
> I don't know. But shouldn't flymake also work when LC_ALL='en_US.UTF-8'? 

It should, but you didn't report a failure in Flymake (which should
use the actual locale), you reported a failure in flymake-tests, which
(for some reason) explicitly sets LC_ALL=C.  If you can show a recipe
for failure in Flymake itself that only happens in a UTF-8 locale,
please do.  Perhaps we will find that both problems are caused by the
same root cause, who knows?

> > And could you perhaps show the error message reported by the failing
> > test(s) in that case?
> 
> The contents of test/lisp/progmodes/flymake-tests.log are attached.

Thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-08 18:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 17:06 bug#70822: flymake mishandles GCC diagnostics in en_US.UTF-8 locale Paul Eggert
2024-05-08 13:05 ` Eli Zaretskii
2024-05-08 17:10   ` Paul Eggert
2024-05-08 18:38     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).