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-18-2011, 05:01 AM
Ray Dillinger
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

On 07/17/2011 05:10 PM, Thomas Dickey wrote:
> fwiw, I routinely build with warnings enabled (and don't have a use for
> -Werror).
>
> For the rest - I'm typically seeing only extra warnings that
> you wouldn't see with -Wall (such as const mismatches, which are
> problematic).
>
> That's for ncurses itself, plus lynx and dialog.
>
> curses.h isn't including <wctype.h>, since none of its declarations need it.
> That's iswgraph and iswspace.
>
> You're seeing implicit for get_wch, since there's no _XOPEN_SOURCE_EXTENDED
> in the compile line. Quoting from man ncurses


Wait, the compile line? I took the documentation you quote for ncurses
below....

> You must also define _XOPEN_SOURCE_EXTENDED when compiling for the
> wide-character library to use the extended (wide-character) func-
> tions.

.... to mean #define _X_OPEN_SOURCE_EXTENDED in the c file before
including headers, as shown in the head of the c file I submitted
with the bug report. That seems to work for me to make these functions
visible - provided I do NOT use --Wall or --Werror. If it's only
possible to define it on the command line, isn't that a bug too?

I'll check and see if I can use --Wall or --Werror with the ncursesw
library if I include _X_OPEN_SOURCE_EXTENDED on the gcc command line
instead of (or in addition to) in the file. But it still can't be
correct behavior for these compile options to have an effect on what
functions are visible/linkable.

Bear



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E23BE37.80801@sonic.net">http://lists.debian.org/4E23BE37.80801@sonic.net
 
Old 07-18-2011, 05:35 AM
Ray Dillinger
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

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

On 07/17/2011 05:10 PM, Thomas Dickey wrote:

> You're seeing implicit for get_wch, since there's no _XOPEN_SOURCE_EXTENDED
> in the compile line.

Okay, after checking:

bear@janus:~/src/xxh$ make display.o
gcc -D_XOPEN_SOURCE_EXTENDED -Wall -Werror -lncursesw -c -o display.o
display.c
bear@janus:~/src/xxh$

using the compile line to specify the option (in this case in addition
to #define _XOPEN_SOURCE_EXTENDED at the beginning of the file) bypasses
the problem.

These two methods of establishing a compile option are supposed to be
equivalent according to gcc's online docs, but here we have a case where
specifying the option on the compile line seems to make the functions
linkable even with -Wall and -Werror, while specifying it by #define at
the start of the file instead exposes a bug where -Wall or -Werror
prevent linking.

This is a clearly superior workaround, since it leaves the functionality
of -Wall and -Werror intact. But this is still a bug;
these things are supposed to be equivalent, and neither is supposed
to be affected by these "unrelated" build options.

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

iQEcBAEBAgAGBQJOI8X/AAoJEAOzWkqOibfNmhYH/1ZYHNQJZtgq6aVzn0hGeAhC
P4RAB+rgyL2FzQGM37+BCUS81dXVhneQvakifQyWurzR0lpIG1 mVpc//lUecXuqq
wah90qEGypKVoJpJxvyTnL2l8ZAWzmSCq+J+XOXbwgmDfOatqT UGCuU/R2yJFYPR
hZp7+LmPeHqqI8bn/5v5HRGqMFDAI9c6+2cvVEIEDhSxw9KjbSO0/Y3iL73JhZLd
EMGNgsoCokWa08fizVTri8DBh/dvakVTlK7e31fGz961E5QG+b2R469agoedYO/m
16OxHjrPqFWRX6N9WGlkbGChdxPGbSH2fR5A4nerGHtqm7EEYS PszSJ3brd8Dg4=
=uYOE
-----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: 4E23C612.4090307@sonic.net">http://lists.debian.org/4E23C612.4090307@sonic.net
 
Old 07-18-2011, 08:08 AM
Thomas Dickey
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

On Sun, 17 Jul 2011, Ray Dillinger wrote:


On 07/17/2011 05:10 PM, Thomas Dickey wrote:

fwiw, I routinely build with warnings enabled (and don't have a use for
-Werror).

For the rest - I'm typically seeing only extra warnings that
you wouldn't see with -Wall (such as const mismatches, which are
problematic).

That's for ncurses itself, plus lynx and dialog.

curses.h isn't including <wctype.h>, since none of its declarations need it.
That's iswgraph and iswspace.

You're seeing implicit for get_wch, since there's no _XOPEN_SOURCE_EXTENDED
in the compile line. Quoting from man ncurses



Wait, the compile line? I took the documentation you quote for ncurses
below....


The standard implies that, and some implementations (I've been burned by
gcc with cygwin as well as more than one vendor Unix) put their predefined
stuff _outside_ any #includes). Best practice puts that on the compile
line.


I'll check and see if I can use --Wall or --Werror with the ncursesw
library if I include _X_OPEN_SOURCE_EXTENDED on the gcc command line
instead of (or in addition to) in the file. But it still can't be
correct behavior for these compile options to have an effect on what
functions are visible/linkable.


yes - but in the report all I saw was the implied declaration aspect,
which is enough for -Werror to whine and die. That's not really the
same as linkable.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110718040419.X1277@mail101.his.com">http://lists.debian.org/20110718040419.X1277@mail101.his.com
 
Old 07-18-2011, 08:57 AM
Matthias Klose
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

On 07/18/2011 07:35 AM, Ray Dillinger wrote:
> On 07/17/2011 05:10 PM, Thomas Dickey wrote:
>
>> You're seeing implicit for get_wch, since there's no _XOPEN_SOURCE_EXTENDED
>> in the compile line.
>
> Okay, after checking:
>
> bear@janus:~/src/xxh$ make display.o
> gcc -D_XOPEN_SOURCE_EXTENDED -Wall -Werror -lncursesw -c -o display.o
> display.c
> bear@janus:~/src/xxh$

should't the ncursesw headers be used? pkg-config --cflags ncursesw

plus, your example will fail when using -Wl,--as-needed. move the library behind
the objects.



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E23F591.9030908@debian.org">http://lists.debian.org/4E23F591.9030908@debian.org
 
Old 07-18-2011, 09:01 AM
Thomas Dickey
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

On Mon, 18 Jul 2011, Matthias Klose wrote:


On 07/18/2011 07:35 AM, Ray Dillinger wrote:

On 07/17/2011 05:10 PM, Thomas Dickey wrote:


You're seeing implicit for get_wch, since there's no _XOPEN_SOURCE_EXTENDED
in the compile line.


Okay, after checking:

bear@janus:~/src/xxh$ make display.o
gcc -D_XOPEN_SOURCE_EXTENDED -Wall -Werror -lncursesw -c -o display.o
display.c
bear@janus:~/src/xxh$


should't the ncursesw headers be used? pkg-config --cflags ncursesw


also --libs

actually, ncurses5-config is the flavor that's more likely to work.
I use that. pkg-config isn't available on more than a minority of
the platforms that I build on (and probably never will be). I see
some differences in the output, now that my attention is drawn there.


plus, your example will fail when using -Wl,--as-needed. move the library behind
the objects.


...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110718045817.Y1277@mail101.his.com">http://lists.debian.org/20110718045817.Y1277@mail101.his.com
 
Old 07-18-2011, 02:39 PM
Ray Dillinger
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

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

>> bear@janus:~/src/xxh$ make display.o
>> gcc -D_XOPEN_SOURCE_EXTENDED -Wall -Werror -lncursesw -c -o display.o
>> display.c
>> bear@janus:~/src/xxh$
>
> should't the ncursesw headers be used?

Sorry, don't understand your message. The ncursesw header is invoked
by the -lncursesw compile line option above, *and* by #include
<ncursesw/curses.h> in the file itself; isn't that enough?!

> pkg-config --cflags ncursesw

Can't use pkg-config on this project; it must be compilable on
machines that don't have it installed.

> plus, your example will fail when using -Wl,--as-needed. move the
library behind
> the objects.

Okay... The synopsis of gcc in the man page says the file to be
compiled should come last in the compile line. That's the only thing
I can see here that could be called an "object". The only thing that
could be called a "library" is specified by an -l option. Rearranging
according to the order of things given in the synopsis, I get:

gcc -c -Wall -Werror -D_XOPEN_SOURCE_EXTENDED -lncursesw -o display.o
display.c

Is that what you meant? And in that case are you calling -Wall and
- -Werror "objects"? and -D_XOPEN_SOURCE_EXTENDED a "library"?
If so why?


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

iQEcBAEBAgAGBQJOJEWGAAoJEAOzWkqOibfNdd4H/2Xo3kOmvArX4em1BBCalbrX
uOwTO+WF5kjMrJNDfUalHhvqDZ6EoCiYjO12nCCQ+lht0vRfxd CySTPvuSo4gUhv
vam9XLAbPZzg7lI9ugDdjZVQRvzAMM3QHCwnPvLtC0gw7qkdkp EGN/dnR331KfcZ
dcDJPm+E2Xudmbtb9+1PjbZo6hMl4c9jDTBQ8+09TZxTbZE+lJ sRXL/d/SHkZEVW
EzOfxzQkF3BWWj3tmUZJ3dk/rxpVH/odUzg5WGgkgr2+0Bn67SPjdVnvOAPj245+
J32Iua+jwTBpFTbZqbeNlU8EiPoHzrVyDAr9jOcScmDe2efkkK 7aQNUHrlzFGjQ=
=xasB
-----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: 4E24458B.806@sonic.net">http://lists.debian.org/4E24458B.806@sonic.net
 
Old 07-18-2011, 04:10 PM
Matthias Klose
 
Default Bug#634200: #634200 gcc -Wall -Werror -lncurses fails to link wide-character ncursesw functions.

On 07/18/2011 04:39 PM, Ray Dillinger wrote:
>> plus, your example will fail when using -Wl,--as-needed. move the
> library behind
>> the objects.
>
> Okay... The synopsis of gcc in the man page says the file to be
> compiled should come last in the compile line. That's the only thing
> I can see here that could be called an "object".

No, the manual page says "infile...".



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

Thread Tools




All times are GMT. The time now is 03:17 AM.

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