[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Bogus compiler warnings
From: |
enztec |
Subject: |
Re: [Bug-apl] Bogus compiler warnings |
Date: |
Thu, 9 Mar 2017 17:47:30 -0700 |
free pascal compiler is the same way - i always try to 'satisfy' the warning
especially with arrays - just to make sure if some code logic fails i can tell
all integers := 0 all strings to '' all related arrays to their typing -
i think it helps with detecting problems
On Thu, 9 Mar 2017 11:29:30 +0100
Alexey Veretennikov <address@hidden> wrote:
> Hi,
>
> I'm trying to compile GNU APL with GCC 3.4.6 armv5. There are couple of
> bogus compiler warnings, mainly about variable might be uninitialized.
> Sometimes the situations are like this:
>
> SomeObject * ptr = new SomeObject(arg);
>
> - here compiler complains (sometimes) what ptr might be used uninitialized.
> I've fixed it by separating variable declaration and initialization with
> the real value, like this:
> In the beginning of the function:
>
> SomeObject * ptr = 0;
>
> ....
> ptr = new SomeObject();
>
> So I can fix them by rearranging a code a little. It doesn't hurt as it
> seems.
> But maybe it is not way to go, to complicate the code to satisfy the
> ancient compiler?
>
> There are other issues, mainly related to HEX macro, where we supply
> pointer to this macro.
> On 32bits machine the conversion int64_t(const char*) produces the warning.
> I could solve them by introducing
> HEX(reinterpret_cast<int64_t>(ptr))
>
> It makes code compile without warnings but looks not that pleasant.
>
> But maybe there is a possibility to turn off -Werror with the ./configure
> option?
>
> Br,
> /Alexey