Unix Technical Forum

Duplicate Symbols - Compiler Warnings

This is a discussion on Duplicate Symbols - Compiler Warnings within the Pgsql General forums, part of the PostgreSQL category; --> Greetings: We are converting from 7.4.19 to 8.3. While compiling our application using version 8.3, I have noticed the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:10 PM
Terry Lee Tucker
 
Posts: n/a
Default Duplicate Symbols - Compiler Warnings

Greetings:

We are converting from 7.4.19 to 8.3. While compiling our application using
version 8.3, I have noticed the following warning from the compiler when
compiling perlAPI.c:

gcc -ggdb -Wall -Wmissing-prototypes -Wmissing-declarations -fforce-addr
-DUNIX-DSTDERR_MSG -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -I/usr/X11R6/include
-I/usr/local/pg83/include -I/usr/local/pg83/include/server
-I/esc/logpro/4.0/pgrnd/prog -c utility/perlAPI.c
In file included
from /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/perl.h:37,
from /esc/logpro/4.0/pgrnd/prog/utility/perlAPI.h:10,
from utility/perlAPI.c:11:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/config.h:2183:1: warning:
"_"redefined
In file included from /usr/local/pg83/include/postgresql/server/postgres.h:48,
from /esc/logpro/4.0/pgrnd/prog/logpro.h:35,
from /esc/logpro/4.0/pgrnd/prog/utility/perlAPI.h:8,
from utility/perlAPI.c:11:
/usr/local/pg83/include/postgresql/server/c.h:94:1: warning: this is the
location of the previous definition

In config.h, the symbol in question on line 2183 is:
#define _(args) args

In c.h (postgres) the offending symbol on line 94 is:
#define _(x) gettext((x))

I expect this to cause random core dumps when putting the application into
production and it concerns me greatly. So, my question is, do you see this as
a serious problem and, if so, what shall I do to resolve it? By the way, this
problem does not exist when compiling with 7.4.19.

TIA
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 09:30 AM
Terry Lee Tucker
 
Posts: n/a
Default Re: Duplicate Symbols - Compiler Warnings

Didn't get any nibbles on this one. Can anybody provide any insight on this?

Thanks...

On Thursday 17 April 2008 10:03, Terry Lee Tucker wrote:
> Greetings:
>
> We are converting from 7.4.19 to 8.3. While compiling our application using
> version 8.3, I have noticed the following warning from the compiler when
> compiling perlAPI.c:
>
> gcc -ggdb -Wall -Wmissing-prototypes -Wmissing-declarations -fforce-addr
> -DUNIX-DSTDERR_MSG -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
> -fno-strict-aliasing -pipe-I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
> -I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -I/usr/X11R6/include
> -I/usr/local/pg83/include -I/usr/local/pg83/include/server
> -I/esc/logpro/4.0/pgrnd/prog -c utility/perlAPI.c
> In file included
> from /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/perl.h:37,
> from /esc/logpro/4.0/pgrnd/prog/utility/perlAPI.h:10,
> from utility/perlAPI.c:11:
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/config.h:2183:1: warning:
> "_"redefined
> In file included from
> /usr/local/pg83/include/postgresql/server/postgres.h:48, from
> /esc/logpro/4.0/pgrnd/prog/logpro.h:35,
> from /esc/logpro/4.0/pgrnd/prog/utility/perlAPI.h:8,
> from utility/perlAPI.c:11:
> /usr/local/pg83/include/postgresql/server/c.h:94:1: warning: this is the
> location of the previous definition
>
> In config.h, the symbol in question on line 2183 is:
> #define _(args) args
>
> In c.h (postgres) the offending symbol on line 94 is:
> #define _(x) gettext((x))
>
> I expect this to cause random core dumps when putting the application into
> production and it concerns me greatly. So, my question is, do you see this
> as a serious problem and, if so, what shall I do to resolve it? By the way,
> this problem does not exist when compiling with 7.4.19.
>
> TIA
> --
> Terry Lee Tucker
> Turbo's IT Manager
> Turbo, division of Ozburn-Hessey Logistics
> 2251 Jesse Jewell Pkwy NE
> Gainesville, GA 30501
> Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
> terry@turbocorp.com
> www.turbocorp.com


--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:30 AM
Tom Lane
 
Posts: n/a
Default Re: Duplicate Symbols - Compiler Warnings

Terry Lee Tucker <terry@chosen-ones.org> writes:
> Didn't get any nibbles on this one. Can anybody provide any insight on this?


You're complaining in the wrong place ... I dunno what perlAPI.c is, but
it's not part of Postgres.

FWIW, plperl.c seems to work around the issue this way:

#include "postgres.h"
/* Defined by Perl */
#undef _

// include Perl headers here

I'm not sure that's entirely the right solution, because Perl's _ macro
is 100% useless in any project that considers ANSI C a prerequisite,
whereas ours could be useful ... but right now plperl doesn't have any
localization so it doesn't need the _ macro anyway.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 09:30 AM
Terry Lee Tucker
 
Posts: n/a
Default Re: Duplicate Symbols - Compiler Warnings

On Thursday 17 April 2008 19:32, Tom Lane wrote:
> Terry Lee Tucker <terry@chosen-ones.org> writes:
> > Didn't get any nibbles on this one. Can anybody provide any insight on
> > this?

>
> You're complaining in the wrong place ... I dunno what perlAPI.c is, but
> it's not part of Postgres.
>
> FWIW, plperl.c seems to work around the issue this way:
>
> #include "postgres.h"
> /* Defined by Perl */
> #undef _
>
> // include Perl headers here
>
> I'm not sure that's entirely the right solution, because Perl's _ macro
> is 100% useless in any project that considers ANSI C a prerequisite,
> whereas ours could be useful ... but right now plperl doesn't have any
> localization so it doesn't need the _ macro anyway.
>
> regards, tom lane


Tom,

Thanks for the reply. I've implemented your suggestion and the warning goes
away. perlAPI.c is our own source file of functions which allows access to
the Perl interpreter which is linked in with the application. We use this to
access various Perl hashes that configure and control the system. We'll do
some serious testing to see if I've broken anything.

As usual, thanks for your invaluable assistance...

--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com