Couple of minor fixes

Started by Magnus Haganderover 20 years ago7 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

Attached match makes a couple of minor changes to get rid of some
annoying compiler warnings:

1) backend/port/win32/sema.c declares a variable inline with the code.
IIRC, that's only allowed in C++. Patch moves declaration to the top of
the function.

2) timezone/localtime.c, transtime() has a const arcument in the
implementation but non-const in declaration.

Definitly minor, but still annoying ;-)

I'm also seeing a lot of signed/unsigned mismatch, but IIRC it was said
at some point that we don't care about those.

//Magnus

Attachments:

minor.patchapplication/octet-stream; name=minor.patchDownload+3-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: Couple of minor fixes

"Magnus Hagander" <mha@sollentuna.net> writes:

Attached match makes a couple of minor changes to get rid of some
annoying compiler warnings:

1) backend/port/win32/sema.c declares a variable inline with the code.
IIRC, that's only allowed in C++. Patch moves declaration to the top of
the function.

Done.

2) timezone/localtime.c, transtime() has a const arcument in the
implementation but non-const in declaration.

I did this the other way (make implementation match declaration).
I think the coding was in fact correct per spec, because const-ness
of an argument value is not part of the function signature.

I'm also seeing a lot of signed/unsigned mismatch, but IIRC it was said
at some point that we don't care about those.

In HEAD? They're all cleaned up according to the compilers I use.

regards, tom lane

#3Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#2)
Re: Couple of minor fixes

2) timezone/localtime.c, transtime() has a const arcument in the
implementation but non-const in declaration.

I did this the other way (make implementation match declaration).
I think the coding was in fact correct per spec, because
const-ness of an argument value is not part of the function signature.

Ok.

I'm also seeing a lot of signed/unsigned mismatch, but IIRC it was
said at some point that we don't care about those.

In HEAD? They're all cleaned up according to the compilers I use.

Yup.
More digging then I guess. Probably a #define that's messe dup
somewhere.

//Magnus

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#3)
Re: Couple of minor fixes

"Magnus Hagander" <mha@sollentuna.net> writes:

I'm also seeing a lot of signed/unsigned mismatch, but IIRC it was
said at some point that we don't care about those.

In HEAD? They're all cleaned up according to the compilers I use.

Yup.
More digging then I guess. Probably a #define that's messe dup
somewhere.

Maybe the issue is in Windows-specific code? I have no idea what the
warning status is for that stuff. In all the stuff I regularly compile,
there are only a couple of warnings and they are flex's fault (so
there's not much we can do about 'em). I think it's good to get rid of
noise warnings as much as possible --- otherwise they can make you miss
important ones.

regards, tom lane

#5Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#4)
Re: Couple of minor fixes

I'm also seeing a lot of signed/unsigned mismatch, but

IIRC it was

said at some point that we don't care about those.

In HEAD? They're all cleaned up according to the compilers I use.

Yup.
More digging then I guess. Probably a #define that's messe dup
somewhere.

Maybe the issue is in Windows-specific code? I have no idea
what the warning status is for that stuff. In all the stuff
I regularly compile, there are only a couple of warnings and
they are flex's fault (so there's not much we can do about
'em). I think it's good to get rid of noise warnings as much
as possible --- otherwise they can make you miss important ones.

Probably. I'll see what I can find. It could also be my build being
broken (I've hacked up the build system pretty bad right now), but I
think I used to see this before as well. Will get back to you on this
;-)

//Magnus

#6Magnus Hagander
magnus@hagander.net
In reply to: Magnus Hagander (#5)
Re: Couple of minor fixes

2) timezone/localtime.c, transtime() has a const arcument in the
implementation but non-const in declaration.

I did this the other way (make implementation match declaration).
I think the coding was in fact correct per spec, because

const-ness of

an argument value is not part of the function signature.

Ok.

Came across another one of those. schemacmds.h has:
extern void AlterSchemaOwner_oid(const Oid schemaOid, Oid newOwnerId);

but schemacmds.c has:
void
AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)

//Magnus

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#6)
Re: Couple of minor fixes

"Magnus Hagander" <mha@sollentuna.net> writes:

Came across another one of those. schemacmds.h has:
extern void AlterSchemaOwner_oid(const Oid schemaOid, Oid newOwnerId);
but schemacmds.c has:
void
AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)

Got it, thanks.

regards, tom lane