public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Brown <kbrown@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: unbreak the build with GCC 7
Date: Fri, 19 Jul 2019 19:11:00 -0000	[thread overview]
Message-ID: <20190719191122.69978.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6b7723a83032bd355d3c529d957fe209cb35b4d9

commit 6b7723a83032bd355d3c529d957fe209cb35b4d9
Author: Ken Brown <kbrown@cornell.edu>
Date:   Fri Jul 19 14:14:33 2019 -0400

    Cygwin: unbreak the build with GCC 7
    
    The recent port to GCC 8 used the 'nonstring' attribute, which is
    unknown to GCC 7.  Define and use an 'ATTRIBUTE_NONSTRING' macro
    instead.

Diff:
---
 winsup/cygwin/include/sys/utmp.h | 11 ++++++++---
 winsup/cygwin/uname.cc           |  8 +++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/include/sys/utmp.h b/winsup/cygwin/include/sys/utmp.h
index acf804a..443c442 100644
--- a/winsup/cygwin/include/sys/utmp.h
+++ b/winsup/cygwin/include/sys/utmp.h
@@ -19,16 +19,21 @@ extern "C" {
 #define ut_name		ut_user
 #endif
 
+#if __GNUC__ >= 8
+#define ATTRIBUTE_NONSTRING __attribute__ ((nonstring))
+#else
+#define ATTRIBUTE_NONSTRING
+#endif
 
 struct utmp
 {
  short	ut_type;
  pid_t	ut_pid;
- char	ut_line[UT_LINESIZE] __attribute__ ((nonstring));
+ char	ut_line[UT_LINESIZE] ATTRIBUTE_NONSTRING;
  char  ut_id[UT_IDLEN];
  time_t ut_time;
- char	ut_user[UT_NAMESIZE] __attribute__ ((nonstring));
- char	ut_host[UT_HOSTSIZE] __attribute__ ((nonstring));
+ char	ut_user[UT_NAMESIZE] ATTRIBUTE_NONSTRING;
+ char	ut_host[UT_HOSTSIZE] ATTRIBUTE_NONSTRING;
  long	ut_addr;
 };
 
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index e323335..3502166 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -17,6 +17,12 @@ details. */
 extern "C" int cygwin_gethostname (char *__name, size_t __len);
 extern "C" int getdomainname (char *__name, size_t __len);
 
+#if __GNUC__ >= 8
+#define ATTRIBUTE_NONSTRING __attribute__ ((nonstring))
+#else
+#define ATTRIBUTE_NONSTRING
+#endif
+
 /* uname: POSIX 4.4.1.1 */
 
 /* New entrypoint for applications since API 335 */
@@ -25,7 +31,7 @@ uname_x (struct utsname *name)
 {
   __try
     {
-      char buf[NI_MAXHOST + 1] __attribute__ ((nonstring));
+      char buf[NI_MAXHOST + 1] ATTRIBUTE_NONSTRING;
       char *snp = strstr (cygwin_version.dll_build_date, "SNP");
 
       memset (name, 0, sizeof (*name));


                 reply	other threads:[~2019-07-19 19:11 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=20190719191122.69978.qmail@sourceware.org \
    --to=kbrown@sourceware.org \
    --cc=cygwin-cvs@sourceware.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 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).