all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
@ 2022-10-02 16:10 Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-10-02 20:20 ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-02 16:10 UTC (permalink / raw)
  To: 58254; +Cc: Paul Eggert

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

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: clang.diff --]
[-- Type: text/x-diff, Size: 253 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 3179 bytes --]


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

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

* bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
  2022-10-02 16:10 bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14 Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-02 20:20 ` Paul Eggert
  2022-10-03 13:00   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2022-10-02 20:20 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 58254-done

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

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.

[-- Attachment #2: 0001-.gitignore-Add-lib-assert.h-Bug-58254.patch --]
[-- Type: text/x-patch, Size: 529 bytes --]

From ffce59b3ade02c696f06f73f81e2df2e5f72ae07 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 2 Oct 2022 13:05:02 -0700
Subject: [PATCH] * .gitignore: Add lib/assert.h (Bug#58254).

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

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


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

* bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
  2022-10-02 20:20 ` Paul Eggert
@ 2022-10-03 13:00   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-03  2:53     ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-03 13:00 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 58254

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

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


[-- Attachment #2: emacs-bug58254.tar.gz --]
[-- Type: application/gzip, Size: 159138 bytes --]

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

* bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14
  2022-10-03 13:00   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-03  2:53     ` Paul Eggert
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggert @ 2022-11-03  2:53 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 58254

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.





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

end of thread, other threads:[~2022-11-03  2:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-02 16:10 bug#58254: 29.0.50; Untracked lib/assert.h with Clang 14 Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-02 20:20 ` Paul Eggert
2022-10-03 13:00   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-03  2:53     ` Paul Eggert

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.