misc/124334: lib/libc/glob.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs

Garrett Cooper gcooper at FreeBSD.org
Fri Jun 6 02:40:04 UTC 2008


>Number:         124334
>Category:       misc
>Synopsis:       lib/libc/glob.c fails to compile under -CURRENT with default warning commentary and custom CFLAGs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 06 02:40:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        8-CURRENT
>Organization:
>Environment:
FreeBSD optimus 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon May 19 02:21:07 PDT 2008     root at optimus:/usr/obj/usr/src/sys/OPTIMUS  i386

>Description:
libc always complains and dies after I cvs sync my srcs, until I apply the following change to correct the types that get passed into g_strchr and globexp2. 

Please see the following patch for more details..

# Helpful portions of make.conf

CFLAGS=-O3 -pipe -fno-strict-aliasing
CPUTYPE=prescott

This issue exists in 7.x as well, pending Warner Losh's changes to the code in revision 1.26 of the file.
>How-To-Repeat:
1. Checkout latest sources from CVS
2. make buildworld "CFLAGS=-O3 -pipe -fno-strict-aliasing" CPUTYPE=prescott
>Fix:
See attached patch.

Patch attached with submission follows:

Index: lib/libc/gen/glob.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/gen/glob.c,v
retrieving revision 1.26
diff -r1.26 glob.c
242c242
< 	const Char* ptr = pattern;
---
> 	Char* ptr = (Char*) pattern;
249,250c249,250
< 	while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL)
< 		if (!globexp2(ptr, pattern, pglob, &rv, limit))
---
> 	while ((ptr = (Char *) g_strchr(ptr, LBRACE)) != NULL)
> 		if (!globexp2((const Char*) ptr, pattern, pglob, &rv, limit))


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list