unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>, emacs-devel@gnu.org
Subject: Re: GCC/clang warning for Complex integers?
Date: Mon, 01 Jul 2024 12:54:23 +0000	[thread overview]
Message-ID: <Z31xN3jdSIhnof0KF6SYPszJrg4D8BI2suR3G5zRFq4Ri9_7rm1slnOrblPMSu1fs495RYWEBRw9T0uwqIVHjh6Vs-00GPngjcj1ZrrMGwU=@protonmail.com> (raw)
In-Reply-To: <86bk3hfhrk.fsf@gnu.org>

On Monday, July 1st, 2024 at 11:55, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Gerd Möllmann gerd.moellmann@gmail.com
> 
> > Date: Mon, 01 Jul 2024 10:40:46 +0200
> > 
> > Does someone know how to get a warning for using imaginary numbers like
> > so (typo)?
> > 
> > unsigned char *data = alloc (nbytes + 1i, IGC_OBJ_STRING_DATA);
> > 
> > That compiles without a warning for me, and one is in for a surprise. I
> > can't find the compiler flag that makes that a warning or error (tried with
> > clang 18 and GCC 14).
> 
> 
> Try compiling with -std=c99. (Caveat: you might get gobs of warnings
> that way.)

That doesn't appear to work here. gcc -Wno-error=pedantic -Wpedantic does work, but causes an (easily-fixed) compilation error (I didn't know -W flags could do that!) in seccomp-filter.c, and tons of warnings about things like statement expressions:

igc.c:1917:25: warning: imaginary constants are a GCC extension
 1917 |   ssize_t count_total = 0i;
      |                         ^~

I'm using the 20240614 version of gcc 13.3.1.

Pip



  reply	other threads:[~2024-07-01 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  8:40 GCC/clang warning for Complex integers? Gerd Möllmann
2024-07-01 11:55 ` Eli Zaretskii
2024-07-01 12:54   ` Pip Cet [this message]
2024-07-01 13:51     ` Po Lu
2024-07-01 14:31       ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Z31xN3jdSIhnof0KF6SYPszJrg4D8BI2suR3G5zRFq4Ri9_7rm1slnOrblPMSu1fs495RYWEBRw9T0uwqIVHjh6Vs-00GPngjcj1ZrrMGwU=@protonmail.com' \
    --to=pipcet@protonmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).