Re: Complier warnings on mingw gcc 4.5.0
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Magnus Hagander <magnus@hagander.net>, Alvaro Herrera <alvherre@commandprompt.com>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, Hiroshi Inoue <inoue@tpf.co.jp>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-12-16T17:15:09Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Make the win32 putenv() override update *all* present versions of the
- 741e4ad7de9e 9.0.0 cited
-
Remove the use of the pg_auth flat file for client authentication.
- e710b65c1c56 9.0.0 cited
Andrew Dunstan <andrew@dunslane.net> writes: > It's working, but I don't think it's right :-) In particular, I don't > believe this, or rather I don't believe that its converse is false: > /* If not HAVE_GETOPT, we are using src/port/getopt.c, which has > optreset */ Yeah, that was a 90% solution. I had first tried to look at whether LIBOBJS contains "getopt.o", but it turns out that some versions of autoconf actively prevent you from referencing that variable at all in configure.in :-(. > The trouble is that while we've forced use of our getopt.c, we haven't > inhibited configure from checking the system's getopt. So on my test > system HAVE_GETOPT is defined. Possibly I was wrong about needing to > have optreset set with use of our port. That's what I thought before. At least in src/port/getopt.c (haven't looked at getopt_long), it would only take one more line of code to make it safe against optreset not being used. All that we need is an invariant that "place" is not pointing at potentially volatile storage when we return -1, and most of the returns have that already. (We don't really care about whether it can be reset without a previous set of calls having been run to completion, because we don't need that.) If the same is true in getopt_long, then what I think we should do is actually *remove* optreset from our implementations, and instead specify that you can only switch to a new argv array after -1 has been returned. That would remove a whole lot of unecessarily tense interactions with the system libraries. This is just in the nature of a cleanup so it probably needn't be backpatched, unless people would rather that code be the same across all branches (which does have its advantages). Comments? regards, tom lane