oid2name silly patch

Started by andrea gelminiover 25 years ago7 messagespatches
Jump to latest
#1andrea gelmini
andrea.gelmini@linux.it

a wild patch for something i need to use.

ciao,
andrea

Attachments:

patch.difftext/plain; charset=us-asciiDownload+2-0
#2Bruce Momjian
bruce@momjian.us
In reply to: andrea gelmini (#1)
Re: oid2name silly patch

a wild patch for something i need to use.

ciao,
andrea

oid2name is now in /contrib/Makefile. As for getopt.h, most platforms
don't have it. BSD/OS has:

#include <stdio.h>
#include <unistd.h>

I have added #include <unistd.h>. Let me know if that helps.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3andrea gelmini
andrea.gelmini@linux.it
In reply to: Bruce Momjian (#2)
Re: oid2name silly patch

On Mon, Feb 12, 2001 at 08:55:31AM -0500, Bruce Momjian wrote:

I have added #include <unistd.h>. Let me know if that helps.

it works, thanks.
there are still two warnings, but they don't hurt the program.

oid2name.c: In function `sql_exec_dumpdb':
oid2name.c:318: warning: passing arg 3 of `sql_exec' makes integer from pointer without a cast
oid2name.c: In function `sql_exec_dumptable':
oid2name.c:335: warning: passing arg 3 of `sql_exec' makes integer from pointer without a cast

ciao,
andrea

#4Bruce Momjian
bruce@momjian.us
In reply to: andrea gelmini (#3)
Re: oid2name silly patch

OK, add #include <stdio.h> to the file. That should fix it.

On Mon, Feb 12, 2001 at 08:55:31AM -0500, Bruce Momjian wrote:

I have added #include <unistd.h>. Let me know if that helps.

it works, thanks.
there are still two warnings, but they don't hurt the program.

oid2name.c: In function `sql_exec_dumpdb':
oid2name.c:318: warning: passing arg 3 of `sql_exec' makes integer from pointer without a cast
oid2name.c: In function `sql_exec_dumptable':
oid2name.c:335: warning: passing arg 3 of `sql_exec' makes integer from pointer without a cast

ciao,
andrea

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: oid2name silly patch

Bruce Momjian <pgman@candle.pha.pa.us> writes:

OK, add #include <stdio.h> to the file. That should fix it.

Seems unlikely, since libpq-fe.h already includes <stdio.h>.

The real problem here is that the code is wrong: it's passing NULL
to an int parameter.

regards, tom lane

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#5)
Re: oid2name silly patch

Thanks. Fix applied. My gcc doesn't complain, even with -Wall, so I
assumed it was a platform-specific issue.

Bruce Momjian <pgman@candle.pha.pa.us> writes:

OK, add #include <stdio.h> to the file. That should fix it.

Seems unlikely, since libpq-fe.h already includes <stdio.h>.

The real problem here is that the code is wrong: it's passing NULL
to an int parameter.

regards, tom lane

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#6)
Re: oid2name silly patch

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Thanks. Fix applied. My gcc doesn't complain, even with -Wall, so I
assumed it was a platform-specific issue.

Well, it is: it'd depend on exactly how NULL is defined by your system's
headers ...

regards, tom lane