Bug 57959

Summary: Sources won't compile when compiler doesn't set __OPTIMIZE__ flag
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: xchatAssignee: Mike A. Harris <mharris>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-03 13:37:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sysoltsev Slawa 2002-01-03 13:37:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
file src/common/cfgfiles.c:
"cfgfiles.c", line 503: error: identifier "LC_CTYPE" is undefined
        locale = setlocale (LC_CTYPE, "");
                            ^
this constant defined into <locale.h> which included into <libintl.h> 
which included into "xchat.h" included into cfgfiles.c.
But <libintl.h> includes <locale.h> only in case when __OPTIMIZE__ flag 
present. Gcc set this flag when optimization is on (-O1, -O2 options). In 
other cases (-g, -O0) this flag undefined and gcc will emit error. Intel 
compiler emits error too because doesn't set __OPTIMIZE__ flag anyway.
To increase Red Hat Linux portability you should include <locale.h> 
evident in your sources (file src/common/cfgfiles.c). 
With this package will be able to be built by icc and by gcc without 
optimization.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. unpack sources
2. do configure stage
3. edit makefile (/src/common/makefile) - remove all instances of -O2 from 
there
4. try to build package 
	

Actual Results:  Received error:
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/include    -march=i386 -
mcpu=i686 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -fno-strict-
aliasing -I/usr/local/include  -I/usr/lib/perl5/5.6.0/i386-linux/CORE  -
I/usr/include/python1.5 -c cfgfiles.c
cfgfiles.c: In function `load_config':
cfgfiles.c:503: `LC_CTYPE' undeclared (first use in this function)
cfgfiles.c:503: (Each undeclared identifier is reported only once
cfgfiles.c:503: for each function it appears in.)
cfgfiles.c:503: warning: assignment makes pointer from integer without a 
cast
make[3]: *** [cfgfiles.o] Error 1


Expected Results:  succesfully built package

Additional info:

Comment 1 Mike A. Harris 2002-01-07 11:52:13 UTC
This is a request that should be made to the upstream xchat maintainers.
You can contact them via http://www.xchat.org