GNU bug report logs - #58254
29.0.50; Untracked lib/assert.h with Clang 14

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Sun, 2 Oct 2022 16:11:02 UTC

Severity: minor

Tags: patch

Found in version 29.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58254 in the body.
You can then email your comments to 58254 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org:
bug#58254; Package emacs. (Sun, 02 Oct 2022 16:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
New bug report received and forwarded. Copy sent to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org. (Sun, 02 Oct 2022 16:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Untracked lib/assert.h with Clang 14
Date: Sun, 02 Oct 2022 19:10:16 +0300
[Message part 1 (text/plain, inline)]
Severity: minor
Tags: patch

In a fresh Git worktree:

  $ ./autogen.sh all && ./configure CC=clang && make && git status
  [...]
  On branch wt/clang
  Untracked files:
    (use "git add <file>..." to include in what will be committed)
          lib/assert.h

  nothing added to commit but untracked files present (use "git add" to track)

This file is not generated with the default CC=gcc; there is only a
lib/assert.in.h present.

Is this TRT?

[clang.diff (text/x-diff, inline)]
diff --git a/.gitignore b/.gitignore
index eb77b2388f..c10b3b33d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,6 +53,7 @@ src/emacs-module.h
 
 # C-level sources built by 'make'.
 lib/alloca.h
+lib/assert.h
 lib/byteswap.h
 lib/dirent.h
 lib/errno.h
[Message part 3 (text/plain, inline)]
Thanks,

-- 
Basil

$ clang --version
Debian clang version 14.0.6-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ gcc --version
gcc (Debian 12.2.0-3) 12.2.0

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2022-10-02 built on tia
Repository revision: eb02c4d23088ed3b6806f2a8df2922301dbd515c
Repository branch: wt/clang
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure CC=clang'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
emacs)

Memory information:
((conses 16 35925 6375)
 (symbols 48 5108 0)
 (strings 32 13083 1735)
 (string-bytes 1 372518)
 (vectors 16 9246)
 (vector-slots 8 147080 8733)
 (floats 8 21 23)
 (intervals 56 211 0)
 (buffers 1000 10))

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 02 Oct 2022 20:21:02 GMT) Full text and rfc822 format available.

Notification sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
bug acknowledged by developer. (Sun, 02 Oct 2022 20:21:02 GMT) Full text and rfc822 format available.

Message #10 received at 58254-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 58254-done <at> debbugs.gnu.org
Subject: Re: bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
Date: Sun, 2 Oct 2022 13:20:48 -0700
[Message part 1 (text/plain, inline)]
On 10/2/22 09:10, Basil L. Contovounesios wrote:
> This file is not generated with the default CC=gcc; there is only a
> lib/assert.in.h present.

That's odd. As far as I can see, lib/assert.h is needed only if you need 
to compile lib/filevercmp.c, lib/nanosleep.c, lib/pipe2.c, 
lib/rawmemchr.c, or lib/strtoimax.c, and I don't see why choosing clang 
over gcc would affect whether these files need to be compiled.

I didn't notice the problem partly because I tested on Fedora 36, where 
none of the above files need to be compiled. Anyway, it is indeed a 
glitch on some platforms and I installed the attached patch to fix the 
annoyance. Thanks for reporting it.
[0001-.gitignore-Add-lib-assert.h-Bug-58254.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58254; Package emacs. (Mon, 03 Oct 2022 13:02:02 GMT) Full text and rfc822 format available.

Message #13 received at 58254 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 58254 <at> debbugs.gnu.org
Subject: Re: bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
Date: Mon, 03 Oct 2022 16:00:51 +0300
[Message part 1 (text/plain, inline)]
Paul Eggert [2022-10-02 13:20 -0700] wrote:

> On 10/2/22 09:10, Basil L. Contovounesios wrote:
>> This file is not generated with the default CC=gcc; there is only a
>> lib/assert.in.h present.
>
> That's odd. As far as I can see, lib/assert.h is needed only if you need to
> compile lib/filevercmp.c, lib/nanosleep.c, lib/pipe2.c, lib/rawmemchr.c, or
> lib/strtoimax.c, and I don't see why choosing clang over gcc would affect
> whether these files need to be compiled.

Out of these, only rawmemchr.c and strtoimax.c are not compiled.
The rest are compiled with both Clang and GCC.

I suspect there's a different culprit: skimming through the attached
build output and config.log files, one set with Clang and the other with
GCC, I see that, in the GCC case, static_assert is determined to be an
<assert.h> macro, whereas in the Clang case the static_assert test
fails.  As a result, gl_ASSERT_H sets GL_GENERATE_ASSERT_H=true.
Is that correct?

Thanks,

-- 
Basil

[emacs-bug58254.tar.gz (application/gzip, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Nov 2022 11:24:06 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 02 Nov 2022 03:59:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58254; Package emacs. (Thu, 03 Nov 2022 02:54:01 GMT) Full text and rfc822 format available.

Message #20 received at 58254 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 58254 <at> debbugs.gnu.org
Subject: Re: bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
Date: Wed, 2 Nov 2022 19:53:34 -0700
On 10/3/22 06:00, Basil L. Contovounesios wrote:
> in the GCC case, static_assert is determined to be an
> <assert.h> macro, whereas in the Clang case the static_assert test
> fails.  As a result, gl_ASSERT_H sets GL_GENERATE_ASSERT_H=true.
> Is that correct?

Yes, that's right. Your version of GCC supports 'static_assert (X)' if 
you've included <assert.h>, whereas your version of Clang doesn't.

Support for 'static_assert (X)' is required by C23, where it works even 
if <assert.h> is not included - a new feature that GCC doesn't support 
yet for C. I expect GCC 13 to support it; I am not sure about how this 
fits into Clang's release schedule.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 Dec 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.