unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 13c8cc58bb: Enable warnings when building as a developer with
@ 2022-04-08 21:58 Paul Eggert
  2022-04-11  3:21 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2022-04-08 21:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Development

> The impression I got from postings around here lead me to think that
> clang posing as an old GCC is something specific to macOS.
> Is that indeed the case?

No, clang poses as old GCC everywhere. If you run "clang -x c /dev/null 
-dM -E" on Fedora 35, you'll see:

#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4

and a bunch of other GCC-specific macros. As I understand it, the GCC 
developers have asked the Clang developers to not pretend to be GCC, but 
the Clang developers have ignored the request.

In my experience, if you enable warnings, Clang generates too many false 
alarms. In particular, I can't build Emacs with Clang and with 
--enable-gcc-warnings, because of the false alarms it generates. So I 
just now suggested privately to Mattias to revert that recent change to 
Emacs configure.ac, so that --enable-gcc-warnings is the default for 
developers only if they're using GCC. It's not worth our time to worry 
about the Clang warnings, since GCC warnings work as well or better.



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

* Re: master 13c8cc58bb: Enable warnings when building as a developer with
  2022-04-08 21:58 master 13c8cc58bb: Enable warnings when building as a developer with Paul Eggert
@ 2022-04-11  3:21 ` Richard Stallman
  2022-04-11  3:28   ` Po Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2022-04-11  3:21 UTC (permalink / raw)
  To: Paul Eggert; +Cc: monnier, Emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Is there a way to distinguish Clang from GCC by running shell commands?
Autoconf could use that to provide a way to distinguish them.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: master 13c8cc58bb: Enable warnings when building as a developer with
  2022-04-11  3:21 ` Richard Stallman
@ 2022-04-11  3:28   ` Po Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Po Lu @ 2022-04-11  3:28 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Paul Eggert, monnier, Emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Is there a way to distinguish Clang from GCC by running shell commands?
> Autoconf could use that to provide a way to distinguish them.

Yes, in fact we already do that in Emacs:

  # clang is unduly picky about some things.
  AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
    [AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM([[
            #ifndef __clang__
              error "not clang";
            #endif
          ]])],
       [emacs_cv_clang=yes],
       [emacs_cv_clang=no])])



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

end of thread, other threads:[~2022-04-11  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 21:58 master 13c8cc58bb: Enable warnings when building as a developer with Paul Eggert
2022-04-11  3:21 ` Richard Stallman
2022-04-11  3:28   ` Po Lu

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