public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jason Merrill	<jason@redhat.com>
Subject: [PATCH] Fix wrong declarations of builtin functions
Date: Thu, 03 Nov 2016 21:52:00 -0000	[thread overview]
Message-ID: <AM4PR0701MB2162FF46DB72F675A0D77694E4A30@AM4PR0701MB2162.eurprd07.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

Hi,

I thought in preparation of the new C++ warning about wrong
declarations of builtin functions it would be good to fix some of the
more obvious bugs in the testsuite first.


Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-testsuite.diff --]
[-- Type: text/x-patch; name="patch-testsuite.diff", Size: 5608 bytes --]

2016-11-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR c++/71973
	* g++.dg/cpp1y/lambda-generic-udt.C: Fix builtin function declaration.
	* g++.dg/init/new15.C: Likewise.
	* g++.dg/ipa/inline-1.C: Likewise.
	* g++.dg/ipa/inline-2.C: Likewise.
	* g++.dg/lto/20080908-1_0.C: Likewise.
	* g++.dg/tc1/dr20.C: Likewise.
	* g++.dg/tree-ssa/inline-1.C: Likewise.
	* g++.dg/tree-ssa/inline-2.C: Likewise.
	* g++.old-deja/g++.law/except1.C: Likewise.
	* g++.old-deja/g++.other/vbase5.C: Likewise.
	* obj-c++.dg/lto/trivial-1_0.mm: Likewise.

Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C
===================================================================
--- gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C	(revision 241831)
+++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C	(working copy)
@@ -14,7 +14,7 @@
   bool shadow = false;
 };
 
-extern "C" void printf(...);
+extern "C" int printf(const char*, ...);
 #define assert(e) if (e); else \
 		 printf ("%s:%d: !(%s)\n", __FILE__, __LINE__, #e), __builtin_abort ();
 
Index: gcc/testsuite/g++.dg/init/new15.C
===================================================================
--- gcc/testsuite/g++.dg/init/new15.C	(revision 241831)
+++ gcc/testsuite/g++.dg/init/new15.C	(working copy)
@@ -1,6 +1,6 @@
 // PR c++/9782
 
-extern "C" void printf(const char*, ...);
+extern "C" int printf(const char*, ...);
 
 template <int>
 struct A {
Index: gcc/testsuite/g++.dg/ipa/inline-1.C
===================================================================
--- gcc/testsuite/g++.dg/ipa/inline-1.C	(revision 241831)
+++ gcc/testsuite/g++.dg/ipa/inline-1.C	(working copy)
@@ -3,7 +3,7 @@
 /* { dg-add-options bind_pic_locally } */
 
 namespace std {
-  extern "C" void puts(const char *s);
+  extern "C" int puts(const char *s);
 }
 
 template <class T, class E> void
Index: gcc/testsuite/g++.dg/ipa/inline-2.C
===================================================================
--- gcc/testsuite/g++.dg/ipa/inline-2.C	(revision 241831)
+++ gcc/testsuite/g++.dg/ipa/inline-2.C	(working copy)
@@ -3,7 +3,7 @@
 /* { dg-add-options bind_pic_locally } */
 
 namespace std {
-  extern "C" void puts(const char *s);
+  extern "C" int puts(const char *s);
 }
 
 template <class T, class E> void
Index: gcc/testsuite/g++.dg/lto/20080908-1_0.C
===================================================================
--- gcc/testsuite/g++.dg/lto/20080908-1_0.C	(revision 241831)
+++ gcc/testsuite/g++.dg/lto/20080908-1_0.C	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-lto-do run }  */
-extern "C" { extern void *memcpy (void *, const void *, unsigned); }
+extern "C" { extern void *memcpy (void *, const void *, __SIZE_TYPE__); }
 
 inline int
 bci (const float &source)
Index: gcc/testsuite/g++.dg/tc1/dr20.C
===================================================================
--- gcc/testsuite/g++.dg/tc1/dr20.C	(revision 241831)
+++ gcc/testsuite/g++.dg/tc1/dr20.C	(working copy)
@@ -2,7 +2,7 @@
 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
 // DR20: Some clarifications needed for 12.8 para 15 
 
-extern "C" void printf(const char*, ...);
+extern "C" int printf(const char*, ...);
 extern "C" void abort(void);
 
 int count = 0;
Index: gcc/testsuite/g++.dg/tree-ssa/inline-1.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/inline-1.C	(revision 241831)
+++ gcc/testsuite/g++.dg/tree-ssa/inline-1.C	(working copy)
@@ -3,7 +3,7 @@
 /* { dg-add-options bind_pic_locally } */
 
 namespace std {
-  extern "C" void puts(const char *s);
+  extern "C" int puts(const char *s);
 }
 
 template <class T, class E> void
Index: gcc/testsuite/g++.dg/tree-ssa/inline-2.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/inline-2.C	(revision 241831)
+++ gcc/testsuite/g++.dg/tree-ssa/inline-2.C	(working copy)
@@ -3,7 +3,7 @@
 /* { dg-add-options bind_pic_locally } */
 
 namespace std {
-  extern "C" void puts(const char *s);
+  extern "C" int puts(const char *s);
 }
 
 template <class T, class E> void
Index: gcc/testsuite/g++.old-deja/g++.law/except1.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.law/except1.C	(revision 241831)
+++ gcc/testsuite/g++.old-deja/g++.law/except1.C	(working copy)
@@ -7,7 +7,7 @@
 // Subject: Bugs
 // Date: Wed, 22 Jul 92 08:29:30 EDT
 
-extern "C" void puts(const char *);
+extern "C" int puts(const char *);
 
 class foo {
 public:
Index: gcc/testsuite/g++.old-deja/g++.other/vbase5.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.other/vbase5.C	(revision 241831)
+++ gcc/testsuite/g++.old-deja/g++.other/vbase5.C	(working copy)
@@ -6,7 +6,7 @@
 // vbases. Normally that's just a pessimization, unfortunately during
 // constructoring it leads to uninitialized reads.
 
-extern "C" int printf (...);
+extern "C" int printf (const char*,...);
 
 int fail = 0;
 
Index: gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm
===================================================================
--- gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm	(revision 241831)
+++ gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm	(working copy)
@@ -1,7 +1,7 @@
 /* { dg-lto-do run } */
 /* { dg-skip-if "Needs OBJC2 ABI" { "*-*-darwin*" && lp64 } { "*" } { "" } } */
 extern "C" {
-extern int printf (char *,...) ;
+extern int printf (const char *,...) ;
 extern void abort (void) ;
 } 
 

             reply	other threads:[~2016-11-03 21:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 21:52 Bernd Edlinger [this message]
2016-11-04 12:35 ` Bernd Schmidt

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=AM4PR0701MB2162FF46DB72F675A0D77694E4A30@AM4PR0701MB2162.eurprd07.prod.outlook.com \
    --to=bernd.edlinger@hotmail.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.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.
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).