Bug 79644 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-14 10:53 UTC by d.binderman
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-18 19:33:57 UTC
Embargoed:


Attachments (Terms of Use)
patch file (15.53 KB, patch)
2002-12-15 17:10 UTC, d.binderman
no flags Details | Diff

Description d.binderman 2002-12-14 10:53:43 UTC
Description of problem:

Hello there,

I just tried to compile package XFree86-4.2.0-72 from Redhat 8.0.

Here are some of the compiler messages.

set_trns.c:132: warning: operation on `pointer' may be undefined
makepsres.c:260: warning: operation on `ch' may be undefined
cfbteblt8.c:465: warning: operation on `dst' may be undefined
cfbteblt8.c:531: warning: operation on `dst' may be undefined
cfbsolidC.c:213: warning: operation on `pdst' may be undefined
cfbsolidC.c:247: warning: operation on `pdst' may be undefined
cfbsolidC.c:300: warning: operation on `pdst' may be undefined
cfbsolidC.c:332: warning: operation on `pdst' may be undefined
cfbsolidC.c:334: warning: operation on `pdst' may be undefined
cfbsolidC.c:366: warning: operation on `pdst' may be undefined
cfbsolidC.c:367: warning: operation on `pdst' may be undefined
cfbsolidC.c:417: warning: operation on `pdst' may be undefined
cfbsolidC.c:418: warning: operation on `pdst' may be undefined
cfbsolidC.c:444: warning: operation on `pdst' may be undefined
cfbsolidC.c:445: warning: operation on `pdst' may be undefined
cfbsolidC.c:472: warning: operation on `pdst' may be undefined
cfbsolidC.c:528: warning: operation on `pdst' may be undefined
cfbsolidC.c:558: warning: operation on `pdst' may be undefined
cfbsolidC.c:582: warning: operation on `pdst' may be undefined
cfbsolidC.c:635: warning: operation on `pdst' may be undefined
cfbsolidC.c:653: warning: operation on `pdst' may be undefined
cfbsolidC.c:678: warning: operation on `pdst' may be undefined
cfbsolidC.c:867: warning: operation on `pdst' may be undefined
cfbsolidC.c:898: warning: operation on `pdst' may be undefined
cfbsolidC.c:945: warning: operation on `pdst' may be undefined
cfbsolidC.c:975: warning: operation on `pdst' may be undefined
cfbsolidC.c:977: warning: operation on `pdst' may be undefined
cfbsolidC.c:1007: warning: operation on `pdst' may be undefined
cfbsolidC.c:1008: warning: operation on `pdst' may be undefined
cfbsolidC.c:1034: warning: operation on `pdst' may be undefined
cfbsolidC.c:1035: warning: operation on `pdst' may be undefined
cfbsolidC.c:1059: warning: operation on `pdst' may be undefined
cfbsolidC.c:1107: warning: operation on `pdst' may be undefined
cfbsolidC.c:1137: warning: operation on `pdst' may be undefined
cfbsolidC.c:1161: warning: operation on `pdst' may be undefined
cfbsolidC.c:1213: warning: operation on `pdst' may be undefined
cfbsolidC.c:1231: warning: operation on `pdst' may be undefined
cfbsolidC.c:1256: warning: operation on `pdst' may be undefined
cfbsolidG.c:647: warning: operation on `pdst' may be undefined
cfbpntwin.c:296: warning: operation on `pdst' may be undefined
cfbpntwin.c:305: warning: operation on `pdst' may be undefined
cfbpntwin.c:324: warning: operation on `pdst' may be undefined
cfbpntwin.c:331: warning: operation on `pdst' may be undefined
cfbpntwin.c:333: warning: operation on `pdst' may be undefined
cfbpntwin.c:340: warning: operation on `pdst' may be undefined
cfbpntwin.c:341: warning: operation on `pdst' may be undefined
cfbpntwin.c:350: warning: operation on `pdst' may be undefined
cfbpntwin.c:355: warning: operation on `pdst' may be undefined
cfbpntwin.c:379: warning: operation on `pdst' may be undefined
cfbpntwin.c:384: warning: operation on `pdst' may be undefined
cfbpntwin.c:388: warning: operation on `pdst' may be undefined
cfbpntwin.c:547: warning: operation on `pdst' may be undefined
cfbpntwin.c:557: warning: operation on `pdst' may be undefined
cfbpntwin.c:578: warning: operation on `pdst' may be undefined
cfbpntwin.c:586: warning: operation on `pdst' may be undefined
cfbpntwin.c:588: warning: operation on `pdst' may be undefined
cfbpntwin.c:596: warning: operation on `pdst' may be undefined
cfbpntwin.c:597: warning: operation on `pdst' may be undefined
cfbpntwin.c:607: warning: operation on `pdst' may be undefined
cfbpntwin.c:612: warning: operation on `pdst' may be undefined
cfbpntwin.c:638: warning: operation on `pdst' may be undefined
cfbpntwin.c:643: warning: operation on `pdst' may be undefined
cfbpntwin.c:647: warning: operation on `pdst' may be undefined
cfbhrzvert.c:107: warning: operation on `addrl' may be undefined
cfbhrzvert.c:108: warning: operation on `addrl' may be undefined
cfbhrzvert.c:112: warning: operation on `addrl' may be undefined
cfbhrzvert.c:113: warning: operation on `addrl' may be undefined
cfbhrzvert.c:117: warning: operation on `addrl' may be undefined
cfbhrzvert.c:128: warning: operation on `addrl' may be undefined
cfbhrzvert.c:129: warning: operation on `addrl' may be undefined
cfbhrzvert.c:133: warning: operation on `addrl' may be undefined
cfbhrzvert.c:134: warning: operation on `addrl' may be undefined
cfbhrzvert.c:138: warning: operation on `addrl' may be undefined
cfbhrzvert.c:145: warning: operation on `addrl' may be undefined
cfbhrzvert.c:148: warning: operation on `addrl' may be undefined
cfbhrzvert.c:164: warning: operation on `addrl' may be undefined
cfbhrzvert.c:169: warning: operation on `addrl' may be undefined
cfbhrzvert.c:173: warning: operation on `addrl' may be undefined
cfbhrzvert.c:243: warning: operation on `addrl' may be undefined
cfbhrzvert.c:244: warning: operation on `addrl' may be undefined
cfbhrzvert.c:245: warning: operation on `addrl' may be undefined
cfbhrzvert.c:248: warning: operation on `addrl' may be undefined
cfbhrzvert.c:249: warning: operation on `addrl' may be undefined
cfbhrzvert.c:252: warning: operation on `addrl' may be undefined
cfbhrzvert.c:256: warning: operation on `addrl' may be undefined
cfbhrzvert.c:257: warning: operation on `addrl' may be undefined
cfbhrzvert.c:258: warning: operation on `addrl' may be undefined
cfbhrzvert.c:264: warning: operation on `addrl' may be undefined
cfbhrzvert.c:267: warning: operation on `addrl' may be undefined
cfbhrzvert.c:271: warning: operation on `addrl' may be undefined
cfbhrzvert.c:272: warning: operation on `addrl' may be undefined
cfb8segC.c:736: warning: operation on `addrp' may be undefined
cfb8segC.c:741: warning: operation on `addrp' may be undefined
cfb8segC.c:757: warning: operation on `addrp' may be undefined
cfb8segC.c:762: warning: operation on `addrp' may be undefined
cfb8segC.c:776: warning: operation on `addrp' may be undefined
cfb8segC.c:807: warning: operation on `addrp' may be undefined
cfb8segC.c:812: warning: operation on `addrp' may be undefined
cfb8segC.c:816: warning: operation on `addrp' may be undefined
screen-cfg.c:381: warning: operation on `unsel_index' may be undefined
screen-cfg.c:383: warning: operation on `unsel_index' may be undefined

There are some many repeats of these error messages, that
I haven't had the patience to fix them all. I've fixed a 
representative collection, fixing the rest is just duplication.

Here is a patch 

*** ./xc/lib/font/Speedo/set_trns.c.old	2002-11-28 13:32:10.000000000 +0000
--- ./xc/lib/font/Speedo/set_trns.c	2002-11-28 13:32:28.000000000 +0000
***************
*** 128,135 ****
  intsize[7] = 0;
  intsize[8] = 0;
  
! n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0) +
!     ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0);
  for (i = 0; i < n; i++)          /* For each entry in int table ... */
      {
      format = NEXT_BYTE(pointer); /* Read format byte */
--- 128,135 ----
  intsize[7] = 0;
  intsize[8] = 0;
  
! n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0);
! n += ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0);
  for (i = 0; i < n; i++)          /* For each entry in int table ... */
      {
      format = NEXT_BYTE(pointer); /* Read format byte */
*** ./xc/programs/makepsres/makepsres.c.old	2002-11-28 13:32:56.000000000 +0000
--- ./xc/programs/makepsres/makepsres.c	2002-11-28 13:33:25.000000000 +0000
***************
*** 257,263 ****
  	    hash += *ch;
  	    return hash % HASHSIZE;
  	}
! 	hash += *ch++ + (*ch++ << 8);
      }
  }
  
--- 257,264 ----
  	    hash += *ch;
  	    return hash % HASHSIZE;
  	}
! 	hash += ch[ 0] + (ch[ 1] << 8);
! 	ch += 2;
      }
  }
  
*** ./xc/programs/Xserver/cfb/cfb8segC.c.old	2002-11-28 18:35:35.000000000 +0000
--- ./xc/programs/Xserver/cfb/cfb8segC.c	2002-11-28 18:35:51.000000000 +0000
***************
*** 733,739 ****
  		  *addrp   = piQxelXor[2];
  		  break;
  		case 1:
! 		  *addrp++ = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
  		  *addrp++ = piQxelXor[1];
  		  *addrp   = piQxelXor[2];
  		  break;
--- 733,740 ----
  		  *addrp   = piQxelXor[2];
  		  break;
  		case 1:
! 		  *addrp = ((*addrp) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
! 		addrp++;
  		  *addrp++ = piQxelXor[1];
  		  *addrp   = piQxelXor[2];
  		  break;
*** ./xc/programs/Xserver/cfb/cfbhrzvert.c.old	2002-11-28 18:34:29.000000000 +0000
--- ./xc/programs/Xserver/cfb/cfbhrzvert.c	2002-11-28 18:35:12.000000000 +0000
***************
*** 104,111 ****
      case 4:
        switch(leftIndex){
        case 0:
! 	*addrl++ = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
! 	*addrl++ = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
  	*addrl   = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
  	break;
        case 1:
--- 104,113 ----
      case 4:
        switch(leftIndex){
        case 0:
! 	*addrl = DoRRop (*addrl, piQxelAnd[0], piQxelXor[0]);
! 	++addrl;
! 	*addrl = DoRRop (*addrl, piQxelAnd[1], piQxelXor[1]);
! 	++addrl;
  	*addrl   = DoRRop (*addrl, piQxelAnd[2], piQxelXor[2]);
  	break;
        case 1:
*** ./xc/programs/Xserver/cfb/cfbpntwin.c.old	2002-11-28 18:33:37.000000000 +0000
--- ./xc/programs/Xserver/cfb/cfbpntwin.c	2002-11-28 18:33:58.000000000 +0000
***************
*** 293,299 ****
  	      break;
  	    case 1:
  	      while(h--){
! 		*pdst++ = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
  		*pdst++ = piQxelArray[1];
  		*pdst   = piQxelArray[2];
  		pdst -=2;
--- 293,300 ----
  	      break;
  	    case 1:
  	      while(h--){
! 		*pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000);
! 		pdst++;
  		*pdst++ = piQxelArray[1];
  		*pdst   = piQxelArray[2];
  		pdst -=2;
*** ./xc/programs/Xserver/cfb/cfbsolidC.c.old	2002-11-28 18:28:52.000000000 +0000
--- ./xc/programs/Xserver/cfb/cfbsolidC.c	2002-11-28 18:33:16.000000000 +0000
***************
*** 1004,1011 ****
  	    case 2:
  /*		pdst++;*/
  #if RROP == GXcopy
! 		    *pdst++ = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
! 		    *pdst-- = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
--- 1004,1013 ----
  	    case 2:
  /*		pdst++;*/
  #if RROP == GXcopy
! 		    *pdst = ((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000);
! 		++pdst;
! 		    *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
! 		--pdst;
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= (piQxelXor[1] & 0xFFFF0000);
***************
*** 1031,1038 ****
  	case 2: /* leftIndex + w = 2*/
  	    if(leftIndex){
  #if RROP == GXcopy
! 		    *pdst++ = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
! 		    *pdst-- = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= (piQxelXor[0] & 0xFF000000);
--- 1033,1042 ----
  	case 2: /* leftIndex + w = 2*/
  	    if(leftIndex){
  #if RROP == GXcopy
! 		    *pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
! 		++pdst;
! 		    *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
!   		    --pdst;
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= (piQxelXor[0] & 0xFF000000);
***************
*** 1056,1062 ****
  	    else{ /*case 2 leftIndex === 0 */
  #if RROP == GXcopy
  		    *pdst++ = piQxelXor[0];
! 		    *pdst-- = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= piQxelXor[0];
--- 1060,1067 ----
  	    else{ /*case 2 leftIndex === 0 */
  #if RROP == GXcopy
  		    *pdst++ = piQxelXor[0];
! 		    *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
! 		    --pdst;
  #endif
  #if RROP == GXxor
  		    *pdst++ ^= piQxelXor[0];
***************
*** 1104,1110 ****
  			break;
  		    case 1:
  #if RROP == GXcopy
! 			*pdst++ = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
  			*pdst++ = piQxelXor[1];
  			*pdst++ = piQxelXor[2];
  #endif
--- 1109,1116 ----
  			break;
  		    case 1:
  #if RROP == GXcopy
! 			*pdst = ((*pdst) & 0xFFFFFF) | (piQxelXor[0] & 0xFF000000);
! 			pdst++;
  			*pdst++ = piQxelXor[1];
  			*pdst++ = piQxelXor[2];
  #endif
***************
*** 1134,1140 ****
  		    break;
  		    case 2:
  #if RROP == GXcopy
! 			*pdst++ = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000));
  			*pdst++ = piQxelXor[2];
  #endif
  #if RROP == GXxor
--- 1140,1147 ----
  		    break;
  		    case 2:
  #if RROP == GXcopy
! 			*pdst = (((*pdst) & 0xFFFF) | (piQxelXor[1] & 0xFFFF0000));
! 			pdst++;
  			*pdst++ = piQxelXor[2];
  #endif
  #if RROP == GXxor
***************
*** 1158,1164 ****
  			break;
  		    case 3:
  #if RROP == GXcopy
! 			*pdst++ = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
  #endif
  #if RROP == GXxor
  			*pdst++ ^= (piQxelXor[2] & 0xFFFFFF00);
--- 1165,1172 ----
  			break;
  		    case 3:
  #if RROP == GXcopy
! 			*pdst = ((*pdst) & 0xFF) | (piQxelXor[2] & 0xFFFFFF00);
! 			pdst++;
  #endif
  #if RROP == GXxor
  			*pdst++ ^= (piQxelXor[2] & 0xFFFFFF00);
***************
*** 1210,1216 ****
  		  break;
  		case 1:
  #if RROP == GXcopy
! 		  *pdst++ = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= (piQxelXor[0] & 0xFFFFFF);
--- 1218,1225 ----
  		  break;
  		case 1:
  #if RROP == GXcopy
! 		  *pdst = ((*pdst) & 0xFF000000) | (piQxelXor[0] & 0xFFFFFF);
! 		  pdst++;
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= (piQxelXor[0] & 0xFFFFFF);
***************
*** 1228,1234 ****
  		case 2:
  #if RROP == GXcopy
  		  *pdst++ = piQxelXor[0];
! 		  *pdst++ = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= piQxelXor[0];
--- 1237,1244 ----
  		case 2:
  #if RROP == GXcopy
  		  *pdst++ = piQxelXor[0];
! 		  *pdst = ((*pdst) & 0xFFFF0000) | (piQxelXor[1] & 0xFFFF);
! 		   pdst++;
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= piQxelXor[0];
***************
*** 1253,1259 ****
  #if RROP == GXcopy
  		  *pdst++ = piQxelXor[0];
  		  *pdst++ = piQxelXor[1];
! 		  *pdst++ = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= piQxelXor[0];
--- 1263,1270 ----
  #if RROP == GXcopy
  		  *pdst++ = piQxelXor[0];
  		  *pdst++ = piQxelXor[1];
! 		  *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelXor[2] & 0xFF);
! 		  pdst++;
  #endif
  #if RROP == GXxor
  		  *pdst++ ^= piQxelXor[0];
*** ./xc/programs/Xserver/cfb/cfbteblt8.c.old	2002-11-28 13:33:45.000000000 +0000
--- ./xc/programs/Xserver/cfb/cfbteblt8.c	2002-11-28 18:26:31.000000000 +0000
***************
*** 300,306 ****
  #define StorePixels(o,p)    dst[o] = p
  #define Loop		    dst += widthDst;
  #else
! #define StorePixels(o,p)    *dst++ = (p)
  #define Loop		    dst += widthLeft;
  #endif
  
--- 300,306 ----
  #define StorePixels(o,p)    dst[o] = p
  #define Loop		    dst += widthDst;
  #else
! #define StorePixels(o,p)    *dst = (p); dst++;
  #define Loop		    dst += widthLeft;
  #endif
  
*** ./xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c.old	2002-11-28 18:36:09.000000000 +0000
--- ./xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c	2002-11-28 18:37:16.000000000 +0000
***************
*** 378,386 ****
  
      tmp = defmodes[unsel_index];
      if (down)
! 	defmodes[unsel_index] = defmodes[++unsel_index];
      else
! 	defmodes[unsel_index] = defmodes[--unsel_index];
      defmodes[unsel_index] = tmp;
  
      XawListUnhighlight(listR);
--- 378,392 ----
  
      tmp = defmodes[unsel_index];
      if (down)
!     {
! 	++unsel_index;
! 	defmodes[ unsel_index] = defmodes[ unsel_index];
!     }
      else
!     {
! 	--unsel_index;
! 	defmodes[ unsel_index] = defmodes[ unsel_index];
!     }
      defmodes[unsel_index] = tmp;
  
      XawListUnhighlight(listR);



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 Mike A. Harris 2002-12-15 08:21:46 UTC
I'm currently unable to test your patch out, as cut and pasted patches get
destroyed by bugzilla and/or cut and pasting.

Please use the bugzilla file attachment feature to attach all files instead
of cut and pasting them into the comment area.  Also, please regenerate the
patch as a standard unified diff, using "diff -u"

thanks.

Comment 2 d.binderman 2002-12-15 17:10:11 UTC
Created attachment 88746 [details]
patch file

This patch is only a partial solution.

Comment 3 Mike A. Harris 2002-12-18 19:33:57 UTC
I can't get this patch to apply.  Something is wrong with the patch,
possibly cut and paste error, or perhaps that it is not a unified diff.

This type of problem, really should be submitted directly to XFree86.org
via the fixes address so that the fixes get into the official
XFree86 source code base, and not specific to one vendor.  Also, applying
such fixes to a vendor local branch would make generic patches to the
stock sources have to be modified to patch over top of this patch.

Please submit a unified diff (diff -u foo.orig foo > foo.patch) to
fixes directly, and once committed to XFree86 CVS it will
naturally be included in Red Hat Linux (and all other distros too) by
default.

Thanks.


Note You need to log in before you can comment on or make changes to this bug.