diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-01-04 08:17:15 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-01-04 08:17:15 +0000 |
commit | df8bc0f3d2869f7ea2982eebb2178cc7ca9092d5 (patch) | |
tree | bae9453026f19b86e9cd465ff527ba1d45a962cb | |
parent | 67316dcf2a547ae9fdbc9122a72cdb06affec500 (diff) |
* config/i386/pmm_malloc.h (posix_memalign): If __cplusplus,
make the prototype extern "C" and add throw ().
* g++.dg/other/i386-2.C: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@109318 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/config/i386/pmm_malloc.h | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-2.C | 12 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 754f14fe879..90d37de683d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2006-01-04 Jakub Jelinek <jakub@redhat.com> + * config/i386/pmm_malloc.h (posix_memalign): If __cplusplus, + make the prototype extern "C" and add throw (). + PR target/25554 * config/i386/i386.md (testqi_ext_3): Ensure len is positive and pos non-negative and pos + len <= 32. diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h index ae09aad31c6..744ac6d41cc 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -31,7 +31,11 @@ /* We can't depend on <stdlib.h> since the prototype of posix_memalign may not be visible. */ +#ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); +#else +extern "C" int posix_memalign (void **, size_t, size_t) throw (); +#endif static __inline void * _mm_malloc (size_t size, size_t alignment) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7dda6a144bd..1e33d4c9c63 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2006-01-04 Jakub Jelinek <jakub@redhat.com> + * g++.dg/other/i386-2.C: New test. + PR target/25554 * gcc.c-torture/compile/20051228-1.c: New test. diff --git a/gcc/testsuite/g++.dg/other/i386-2.C b/gcc/testsuite/g++.dg/other/i386-2.C new file mode 100644 index 00000000000..b988f9d93da --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-2.C @@ -0,0 +1,12 @@ +/* Test that {,x,e,p}mmintrin.h and mm_malloc.h are + usable with -pedantic-errors. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-pedantic-errors -msse3" } */ + +#include <mmintrin.h> +#include <xmmintrin.h> +#include <emmintrin.h> +#include <pmmintrin.h> +#include <mm_malloc.h> + +int dummy; |