Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: warning.patch
Description: text/x-patch (4.6 KB)

Responses

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group