Thread: Latest datetime changes produce gcc complaints

Latest datetime changes produce gcc complaints

From
Tom Lane
Date:
make[3]: Entering directory `/home/postgres/pgsql/src/backend/parser'
gcc -O1 -Wall -Wmissing-prototypes -Wmissing-declarations -g -I../../../src/include   -c -o analyze.o analyze.c
In file included from analyze.c:23:
../../../src/include/parser/parse.h:160: warning: `TIME' redefined
../../../src/include/utils/datetime.h:113: warning: this is the location of the previous definition

and similarly in half a dozen other modules.  This is very bad; I have
no confidence that the correct value of the symbol is being used in each
place that references it.  Could we rename the one in datetime.h to a
non-conflicting name?
        regards, tom lane


Re: Latest datetime changes produce gcc complaints

From
Bruce Momjian
Date:
> make[3]: Entering directory `/home/postgres/pgsql/src/backend/parser'
> gcc -O1 -Wall -Wmissing-prototypes -Wmissing-declarations -g -I../../../src/include   -c -o analyze.o analyze.c
> In file included from analyze.c:23:
> ../../../src/include/parser/parse.h:160: warning: `TIME' redefined
> ../../../src/include/utils/datetime.h:113: warning: this is the location of the previous definition
> 
> and similarly in half a dozen other modules.  This is very bad; I have
> no confidence that the correct value of the symbol is being used in each
> place that references it.  Could we rename the one in datetime.h to a
> non-conflicting name?

Of course this brings up the question of whether there were any other
recent changes that will break ports.   Thomas, can you check on that? 
I didn't see your patch and can't find it in the archives.  (Of course,
the fact the patch didn't compile and we are thinking of RC1 tomorrow
doesn't help.)  :-)

OK, I see it now via CVS.  There are almost 2k lines of code in the
patch. It looks like DATE and TIME are the only two new defines.  Can
you change TIME to PGTIME and DATE to PGDATE?  Seems safer.

Don't know about the rest of the code.  Hope it works.  :-)

--  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,
Pennsylvania19026
 


Re: Latest datetime changes produce gcc complaints

From
Thomas Lockhart
Date:
> and similarly in half a dozen other modules.  This is very bad; I have
> no confidence that the correct value of the symbol is being used in each
> place that references it.  Could we rename the one in datetime.h to a
> non-conflicting name?

Yup. Sorry. Will fix it up tonight.
                 - Thomas


Re: Latest datetime changes produce gcc complaints

From
Thomas Lockhart
Date:
> > ... Could we rename the one in datetime.h to a
> > non-conflicting name?

OK, renamed to "ISOTIME", since it is a field defined in ISO-8601. I did
a "make clean all install" and the regression tests pass.

> Of course this brings up the question of whether there were any other
> recent changes that will break ports.   Thomas, can you check on that?

Not sure what you mean here. I made changes in only a few files. Not
sure about other recent changes of course, any more than you are. Better
keep testing, eh?

> Don't know about the rest of the code.  Hope it works.  :-)

Without any more changes, it certainly works "better" than the old code.
Whether it breaks a case that used to work is not known, but all of the
regress tests plus more tests I've written all pass. Features which
didn't used to work now do, and some inconsistancies have been repaired.
These are all bug fixes, and I'll continue to poke at the docs to get
the features more completely illuminated (which is how I got to patching
in the first place).
                   - Thomas