Обсуждение: Couple of minor fixes
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
Вложения
"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
> > 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
"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
> >>> 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
> > > 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
"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