pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48758: textproc/json 0.12 gcc >= 4.6 on NetBSD and DragonFly [-Werror=unused-but-set-variable]



>Number:         48758
>Category:       pkg
>Synopsis:       textproc/json 0.12 gcc >= 4.6 on NetBSD and DragonFly 
>[-Werror=unused-but-set-variable]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 20 02:25:00 +0000 2014
>Originator:     David Shao
>Release:        DragonFly 3.7-DEVELOPMENT x86_64
>Organization:
>Environment:
DragonFly  3.7-DEVELOPMENT DragonFly v3.7.1.1092.g7b92e-DEVELOPMENT #0: Thu Apr 
17 09:23:40 PDT 2014     xxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64

>Description:
For pkgsrc cvs on both DragonFly 3.7-DEVELOPMENT x86_64 with
cc --version
cc 4.7.3 [DragonFly] Release/2013-04-11

and NetBSD 6.99.40 amd64 with
cc --version
cc (NetBSD nb2 20140304) 4.8.3

textproc/json-c 0.12 fails to build with:

libtool: compile:  cc -DHAVE_CONFIG_H -I. -Wall -Werror 
-Wno-error=deprecated-declarations -Wextra -Wwrite-strings 
-Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE -D_REENTRANT -g -MT 
json_tokener.lo -MD -MP -MF .deps/json_tokener.Tpo -c json_tokener.c  -fPIC 
-DPIC -o .libs/json_tokener.o
json_tokener.c: In function 'json_tokener_parse_ex':
json_tokener.c:355:6: error: variable 'size' set but not used 
[-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

The reason I mention the gcc version is that this may be related to:

http://gcc.gnu.org/gcc-4.6/porting_to.html

"The behavior of -Wall has changed and now includes the new warning flags 
-Wunused-but-set-variable and (with -Wall -Wextra) -Wunused-but-set-parameter. 
This may result in new warnings in code that compiled cleanly with previous 
versions of GCC."
>How-To-Repeat:

>Fix:
textproc/json 0.12 can be successfully built and replaced on DragonFly 
3.7-DEVELOPMENT with the hack in Makefile adding the lines:

.if ${OPSYS} == "DragonFly"
CFLAGS+=        -Wno-error=unused-but-set-variable
.endif

but in light of building also failing on NetBSD 6.99.40, something probably 
needs to be changed instead in Makefile's:

.if !empty(PKGSRC_COMPILER:Mclang)
CFLAGS+=        -Wno-tautological-compare -Wno-unused-value
.endif



Home | Main Index | Thread Index | Old Index