FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 07-17-2011, 05:03 PM
Ray Dillinger
 
Default Bug#634200: gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

Package: gcc
Version: 4:4.4.5-1
Severity: normal
Tags: l10n

In reply to your
Fwd: Message with no Package: tag cannot be processed!(...)

(reportbug fails on my system due to sendmail not being installed.
Like most sane people I use Qmail. should I file a bug against
reportbug?)
----original message---
I'm reporting this bug against GCC (current version installed is
4:4.4.5-1)

This is an internationalization bug.

This is "Normal" priority (priority 6).

There is a workaround: never use -Wall or -Werror on the same gcc
command line with -lncursesw or to link files that #include <wctype.h> .


My usual build options are "gcc -Wall -Werror ..." In attempting to
link an ncursesw package I found that the wide-character functions in
ncursesw were not linkable. In trying ever-more-trival cases to try
to figure it out, I eventually (accidentally) built straight from
the command line, leaving out the build options, and a call to a
wide-character function linked. After some confusion, I realized that
the relevant difference was the absence of my usual build options
rather than whatever-it-was that I was testing. Taking the build
options out of my makefile allowed the main project I was working on
to build. Experimentation reveals that either of these build options
(-Wall or -Werror) is sufficient to prevent linking.

The bug against gcc is that regardless of the extreme macrology in
/lib/include/ncursesw/ncurses.h and /lib/include/wctype.h these
build options ought not affect the linker's view of available
functions.

Affected functions include basically everything which uses the wide
character type defined in wctype.h or the functions defined on ints
in ctype.h. These functions include, but are probably not limited to,

in_wch, mvin_wch, mvwin_wch, win_wch, get_wch, wget_wch, mvget_wch,
mvwget_wch, unget_wch, get_wstr, getn_wstr, wget_wstr, wgetn_wstr,
mvget_wstr, mvgetn_wstr, mvwget_wstr, mvwgetn_wstr,get_wstr, getn_wstr,
wget_wstr, wgetn_wstr, mvget_wstr, mvgetn_wstr, mvwget_wstr,
mvwgetn_wstr, ins_wch, mvins_wch, mvwins_wch, wins_wch, iswgraph,
isgraph, iswspace, isspace, iswalnum, isalnum, iswctype, etc.

example of the error:

bear@janus:~/src/xxh$make display.o
make display.o
gcc -Wall -Werror -lncursesw -c -o display.o display.c
cc1: warnings being treated as errors
display.c: In function ‘Disp_GetKey’:
display.c:183: error: implicit declaration of function ‘get_wch’
display.c: In function ‘Disp_GetKeynames’:
display.c:334: error: implicit declaration of function ‘iswgraph’
display.c: In function ‘Disp_Say’:
display.c:1333: error: implicit declaration of function ‘iswspace’
..........etc........
make: *** [display.o] Error 1
bear@janus:~/src/xxh$


display.c starts with the lines:


#define _X_OPEN_SOURCE_EXTENDED

/* stdlib for qsort */
#include <stdlib.h>
/* wchar for wint_t type */
#include <wchar.h>
/* wide ncurses for display and input handling */
#include <ncursesw/curses.h>
/* malloc for calloc and free */
#include <malloc.h>
/* string.h for memcpy */
#include <string.h>
#include <assert.h>


......etc.......




Ray "Bear" Dillinger

My system: AMD64, dual-core, prefer 'stable' release, up-to-date as of
July 16 2011.




--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E2315F2.8040409@sonic.net">http://lists.debian.org/4E2315F2.8040409@sonic.net
 
Old 07-18-2011, 09:31 AM
Kalle Olavi Niemitalo
 
Default Bug#634200: gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

Ray Dillinger <bear@sonic.net> writes:

> display.c starts with the lines:
>
>
> #define _X_OPEN_SOURCE_EXTENDED

There is an extra underscore after the X.
Correcting that fixes the implicit-declaration error for me.

Also, for consistency with other uses of this macro, it would be
best to define it with the value 1, like -D_XOPEN_SOURCE_EXTENDED
does if the value is not specified:

#define _XOPEN_SOURCE_EXTENDED 1

The value does not seem to matter for ncursesw, though.



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87sjq4q6jl.fsf@Pulska.kon.iki.fi">http://lists.debian.org/87sjq4q6jl.fsf@Pulska.kon.iki.fi
 
Old 07-18-2011, 02:16 PM
Ray Dillinger
 
Default Bug#634200: gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/18/2011 02:31 AM, Kalle Olavi Niemitalo wrote:
> Ray Dillinger <bear@sonic.net> writes:
>
>> display.c starts with the lines:
>>
>>
>> #define _X_OPEN_SOURCE_EXTENDED
>
> There is an extra underscore after the X.
> Correcting that fixes the implicit-declaration error for me.

D'oh! Okay, that's embarrassing, but it explains the whole
thing. With the variable undefined, link warnings and errors
were generated, and either -Wall or -Werror was enough to catch
them and stop the build.

So, no bug? Are we just looking at the agreed-upon semantics?

Bear



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOJEAgAAoJEAOzWkqOibfNA7YH/ih4BOZaYW4S3EO8HRjNMRiq
Rnp2E1+cyv3Bb7EqfkyXEL2y2RaudGPKZsioFoDVZq6+ONEpkm UCo2ygA0qZZiLB
Ega5h5AQtqO44Nm9Rq8QtUA7komQrQyVTC3Sj9Sy7H2VahIL2r 6bgznbkaIQyLfb
8I8f5yr9QL6w2rTC/nU5J5L+LO5lASMG7g7kX5x/a9G4gWDM6gnbanx0mN2dEm1k
ZEj+02r0xk6fHS8hBqTNCXfsITD06Tjpj8G/vhgetysVHI2hsYZbJpFJpM/OeeL9
/4fw4NB1LsVwBQzaGdi7da4ke83+MvEbCbouAbaiWb9YhfwB42H 5RvYi7Ie2F7w=
=QWry
-----END PGP SIGNATURE-----



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E24403C.6000306@sonic.net">http://lists.debian.org/4E24403C.6000306@sonic.net
 

Thread Tools




All times are GMT. The time now is 12:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org