public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/1960] New: MAX usage in io/fts.c with side effects
@ 2005-12-01 16:09 heiko dot nardmann at secunet dot com
  2005-12-21  8:24 ` [Bug libc/1960] " drepper at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: heiko dot nardmann at secunet dot com @ 2005-12-01 16:09 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libc/1960] MAX usage in io/fts.c with side effects
  2005-12-01 16:09 [Bug libc/1960] New: MAX usage in io/fts.c with side effects heiko dot nardmann at secunet dot com
@ 2005-12-21  8:24 ` drepper at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: drepper at redhat dot com @ 2005-12-21  8:24 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2005-12-21 08:24 -------
I applied such a change to the trunk.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-21  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-01 16:09 [Bug libc/1960] New: MAX usage in io/fts.c with side effects heiko dot nardmann at secunet dot com
2005-12-21  8:24 ` [Bug libc/1960] " drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).