Bug 82187 - broken source code
broken source code
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: linc (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
: MoveUpstream, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-19 05:20 EST by d.binderman
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
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:


Attachments (Terms of Use)

  None (edit)
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)

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