Bug 82187

Summary: broken source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: lincAssignee: Havoc Pennington <hp>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0Keywords: MoveUpstream, Triaged
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-19 10:48:50 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description d.binderman 2003-01-19 05:20:16 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I just tried to compile package linc-0.5.2-2 from Redhat 8.0

The compiler said

linc-protocols.c:419: warning: operation on `idx' may be undefined

Function parameter evaluation order is undefined. 
Here is an untested patch to shut up the compiler

*** ./src/linc-protocols.c.old	2003-01-16 20:39:48.000000000 +0000
--- ./src/linc-protocols.c	2003-01-16 20:40:34.000000000 +0000
***************
*** 414,422 ****
  		gettimeofday (&t, NULL);
  		g_snprintf (buf, sizeof (buf),
  			    "%s/linc-%x-%x-%x%x", linc_tmpdir,
! 			    pid, idx++,
  			    (guint) (rand() ^ t.tv_sec),
  			    (guint) (idx ^ t.tv_usec));
  #ifdef CONNECTION_DEBUG
  		if (g_file_test (buf, G_FILE_TEST_EXISTS))
  			g_warning ("'%s' already exists !", buf);
--- 414,423 ----
  		gettimeofday (&t, NULL);
  		g_snprintf (buf, sizeof (buf),
  			    "%s/linc-%x-%x-%x%x", linc_tmpdir,
! 			    pid, idx,
  			    (guint) (rand() ^ t.tv_sec),
  			    (guint) (idx ^ t.tv_usec));
+ 		idx++;
  #ifdef CONNECTION_DEBUG
  		if (g_file_test (buf, G_FILE_TEST_EXISTS))
  			g_warning ("'%s' already exists !", buf);

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


How reproducible:
Always

Steps to Reproduce:
1. compile the program
2.
3.
    

Additional info
Comment 1 Havoc Pennington 2003-01-19 10:48:50 EST
Filed as http://bugzilla.gnome.org/show_bug.cgi?id=103879, 
thanks. (Closing here but we will get the fix in a new version of 
linc)