This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug libc/1960] New: MAX usage in io/fts.c with side effects


In io/fts.c the macro MAX is used with the first argument being a function  
call:  
  
	if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))  
		goto mem1;  
  
This may lead to side effects. How about rewriting this with  
  
 
	{ 
	  size_t maxarglen = fts_maxarglen(argv); 
	  if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN))) 
		goto mem1; 
	} 
 
Or is the side effect intended? 
 
A second effect is that glibc gets a little bit faster ... ;-)

-- 
           Summary: MAX usage in io/fts.c with side effects
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: heiko dot nardmann at secunet dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=1960

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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