Compiler warning cleanup - unitilized const variables, pointer type mismatch

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Compiler warning cleanup - unitilized const variables, pointer type mismatch
Date: 2009-05-28 09:11:20
Message-ID: 1243501880.1372.23.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I attached another cleanup patch which fixes following warnings reported
by Sun Studio:

"zic.c", line 1534: warning: const object should have initializer: tzh0
"dynloader.c", line 7: warning: empty translation unit
"pgstat.c", line 666: warning: const object should have initializer: all_zeroes
"pgstat.c", line 799: warning: const object should have initializer: all_zeroes
"pgstat.c", line 2552: warning: const object should have initializer: all_zeroes
"preproc.c", line 39569: warning: pointer expression or its operand do not point to the same object yyerror_range, result is undefined and non-portable
"tab-complete.c", line 587: warning: assignment type mismatch:
pointer to function(pointer to const char, int, int) returning pointer to pointer to char "=" pointer to void

Following list is still unfixed plus see my comments:

"gram.c", line 28487: warning: pointer expression or its operand do not point to the same object yyerror_range, result is undefined and non-portable

- This is really strange warning. The code is really strange
because it points to -1 index of array, but I'm not bison guru.
Maybe it is correct, but it would be good if somebody check it.

"../../../src/include/pg_config.h", line 782: warning: macro redefined: _FILE_OFFSET_BITS

- This probably needs some extra love in configure.

"regc_lex.c", line 401: warning: loop not entered at top
"regc_lex.c", line 484: warning: loop not entered at top
"regc_lex.c", line 578: warning: loop not entered at top
"regc_lex.c", line 610: warning: loop not entered at top
"regc_lex.c", line 870: warning: loop not entered at top
"regc_lex.c", line 1073: warning: loop not entered at top
"postgres.c", line 3845: warning: loop not entered at top

- Assert on not reached place probably confuse compiler. I'm not
sure if it make sense nowadays? Most compiler should optimize
this anyway and code is removed. I suppose to remove these
asserts.

Zdenek

Attachment Content-Type Size
warning.patch text/x-patch 4.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2009-05-28 09:29:08 Re: User-facing aspects of serializable transactions
Previous Message Dimitri Fontaine 2009-05-28 08:34:11 Re: search_path vs extensions