This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR19090] Add -Wno-pointer-sign option


Hi,

On Mon, 17 Jan 2005, Andi Kleen wrote:

> Well you could say that the test case already exists, since the
> warning is enabled by default and there is a test case for the warning.
> 
> Also from a quick look at the dejagnu docs there is "do-no-warning"

It's dg-bogus ;-)

The below test (which is an "inverted" conv-2.c) should does what's 
wanted.  Only quickly tested.


Ciao,
Michael.
	* gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign

/* { dg-do compile } */
/* { dg-options "-Wno-pointer-sign" } */

void f1(long *);
void f2(unsigned long *);

int main()
{
  long *lp;
  unsigned long *ulp;
  char *cp;
  unsigned char *ucp;
  signed char *scp;

  ulp = lp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  lp = ulp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  f1(ulp);	/* { dg-bogus " differ in signedness" } */
  f2(lp);	/* { dg-bogus " differ in signedness" } */

  cp = ucp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  cp = scp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  ucp = scp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  ucp = cp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  scp = ucp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
  scp = cp;	/* { dg-bogus " pointer targets in assignment differ in signedness" } */
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]