Summary:ASTERISK-02500: [patch] remove warning from localtime.c
Reporter:jacs (jacs)Labels:
Date Opened:2004-09-29 05:58:21Date Closed:2011-06-07 14:12:00
Versions:Frequency of
Environment:Attachments:( 0) localtime.c.diff
( 1) localtime[1].c.diff.txt
Description:Compiler warning
warning: assignment discards qualifiers from pointer target type.


get the same warning for

usage elsewhere but not sure how to get around that.
Comments:By: Brian West (bkw918) 2004-09-29 09:11:43

Please add .txt on all diff's so we can view them online.

By: Tilghman Lesher (tilghman) 2004-09-30 22:15:57

Exactly which line are you getting this error on?  I'm not getting this warning at all.  Even if I were getting this error, disposing of the const qualifier generally isn't the right action (instead, you should fix the actual problem, not the symptom).

By: jacs (jacs) 2004-10-01 03:00:35

Lets start by saying I am using gcc 3.4.2. Its also a warning not an error, I've been going through and trying to get rid of as many warnings as possible. the cont string gmt is used only once in localtime.c

struct tm * const tmp;
tmp->TM_ZONE = gmt;

You will also notice, if you look at the code, that there is a similar definition and usage for wildabbr.

static char  wildabbr[] = "WILDABBR";
tmp->TM_ZONE = wildabbr;

but wildabbr was not made constant so all I did was made the two definitions consistent.

By: Tilghman Lesher (tilghman) 2004-10-02 12:53:44

Appears to be a bug in the compiler.