public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncation
@ 2019-07-17 15:09 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-07-17 15:09 UTC (permalink / raw)
  To: cygwin-cvs

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

commit b66dddb56d14a4032969fe8bb92d64baa6e0362e
Author: Ken Brown <kbrown@cornell.edu>
Date:   Mon Jul 15 15:02:00 2019 -0400

    Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncation

Diff:
---
 winsup/cygwin/environ.cc         | 2 +-
 winsup/cygwin/include/sys/utmp.h | 6 +++---
 winsup/cygwin/uname.cc           | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index a47ed72..1248427 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -644,7 +644,7 @@ _addenv (const char *name, const char *value, int overwrite)
 	return -1;		/* Oops.  No more memory. */
 
       /* Put name '=' value into current slot. */
-      strncpy (envhere, name, namelen);
+      memcpy (envhere, name, namelen);
       envhere[namelen] = '=';
       strcpy (envhere + namelen + 1, value);
     }
diff --git a/winsup/cygwin/include/sys/utmp.h b/winsup/cygwin/include/sys/utmp.h
index d90517c..acf804a 100644
--- a/winsup/cygwin/include/sys/utmp.h
+++ b/winsup/cygwin/include/sys/utmp.h
@@ -24,11 +24,11 @@ struct utmp
 {
  short	ut_type;
  pid_t	ut_pid;
- char	ut_line[UT_LINESIZE];
+ char	ut_line[UT_LINESIZE] __attribute__ ((nonstring));
  char  ut_id[UT_IDLEN];
  time_t ut_time;
- char	ut_user[UT_NAMESIZE];
- char	ut_host[UT_HOSTSIZE];
+ 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 306cdee..e323335 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -25,7 +25,7 @@ uname_x (struct utsname *name)
 {
   __try
     {
-      char buf[NI_MAXHOST + 1];
+      char buf[NI_MAXHOST + 1] __attribute__ ((nonstring));
       char *snp = strstr (cygwin_version.dll_build_date, "SNP");
 
       memset (name, 0, sizeof (*name));


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-17 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 15:09 [newlib-cygwin] Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncation Ken Brown

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