All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Define _GNU_SOURCE for a declaration of strptime
Date: Wed, 14 Dec 2022 22:32:39 +0100	[thread overview]
Message-ID: <87fsdhllhk.fsf@oldenburg.str.redhat.com> (raw)

This is needed for compatibility with future C compilers which reject
implicit function declarations by default.  Without _GNU_SOURCE (or a
similar feature test macro), <time.h> does not declare the strptime
function, and compilation can fail.

---
 Make.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Make.rules b/Make.rules
index 903a5a4..d4de1ef 100644
--- a/Make.rules
+++ b/Make.rules
@@ -14,7 +14,7 @@ else
 $(error unknown architecture $(ARCH))
 endif
 INCDIR	   = -I$(TOPDIR)include/ -I/usr/include/efi -I/usr/include/efi/$(ARCH) -I/usr/include/efi/protocol
-CPPFLAGS   = -DCONFIG_$(ARCH)
+CPPFLAGS   = -DCONFIG_$(ARCH) -D_GNU_SOURCE
 CFLAGS	   = -O2 -g $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check
 LDFLAGS	   = -nostdlib
 CRTOBJ		= crt0-efi-$(ARCH).o

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>


                 reply	other threads:[~2022-12-14 21:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=87fsdhllhk.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.
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.