Can someone explain this code?

Started by Magnus Haganderover 18 years ago5 messages
#1Magnus Hagander
magnus@hagander.net

int
pg_fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
const char *password, char *PQerrormsg)
{
#ifndef KRB5
(void) hostname; /* not used */
#endif

...

(fe-auth.c)

What does that code actually *do*?

//Magnus

#2Stephen Frost
sfrost@snowman.net
In reply to: Magnus Hagander (#1)
Re: Can someone explain this code?

* Magnus Hagander (magnus@hagander.net) wrote:

#ifndef KRB5
(void) hostname; /* not used */
#endif

[...]

What does that code actually *do*?

Stop the compiler from complaining about an unused argument.

Thanks,

Stephen

#3Marko Kreen
markokr@gmail.com
In reply to: Magnus Hagander (#1)
Re: Can someone explain this code?

On 7/19/07, Magnus Hagander <magnus@hagander.net> wrote:

int
pg_fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
const char *password, char *PQerrormsg)
{
#ifndef KRB5
(void) hostname; /* not used */
#endif

...

(fe-auth.c)

What does that code actually *do*?

Somebody tried to work around "unused argument" warning?

--
marko

#4Magnus Hagander
magnus@hagander.net
In reply to: Stephen Frost (#2)
Re: Can someone explain this code?

On Thu, Jul 19, 2007 at 06:41:17AM -0400, Stephen Frost wrote:

* Magnus Hagander (magnus@hagander.net) wrote:

#ifndef KRB5
(void) hostname; /* not used */
#endif

[...]

What does that code actually *do*?

Stop the compiler from complaining about an unused argument.

That makes sense, except my compiled didn't warn even when I took it out
:-) Ah, well, thanks for clearifying.

//Magnus

#5Stephen Frost
sfrost@snowman.net
In reply to: Magnus Hagander (#4)
Re: Can someone explain this code?

* Magnus Hagander (magnus@hagander.net) wrote:

On Thu, Jul 19, 2007 at 06:41:17AM -0400, Stephen Frost wrote:

Stop the compiler from complaining about an unused argument.

That makes sense, except my compiled didn't warn even when I took it out
:-) Ah, well, thanks for clearifying.

It depends on the compiler you're using.. My recollection is that
it shows up at least w/ gcc and -Wall and/or -pedantic.

Thanks,

Stephen