warnings reported by Clang

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

warnings reported by Clang

Vishnu
There are some warnings reported by Clang on linux64 with gcc 4.2.4. The warnings show up in the boost-geometry-0.9.0 header files. All warnings are due to uninitialized arguments.

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:35: warning: variable 'st' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:25: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
                        ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
            ^~~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:25: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
                        ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
            ^~~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:35: warning: variable 'st' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
                                  ^~
/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
            ^~~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:29: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                            ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:39: warning: variable 'st' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                                      ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:25: warning: variable 'p' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                        ^
/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:25: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
                        ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
            ^~~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:35: warning: variable 'st' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);
                                  ^~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:39: warning: variable 'st' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                                      ^~
/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:25: warning: variable 'p' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                        ^

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
            ^~~

/usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/within_concept.hpp:51:29: warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
            str->apply(*p, *sp, *sp, *st);
                            ^~
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Barend



> There are some warnings reported by Clang on linux64 with gcc 4.2.4. The
> warnings show up in the boost-geometry-0.9.0 header files. All warnings are
> due to uninitialized arguments.
>
> /usr/devsrc/boost_1_46_1/boost/geometry/strategies/concepts/area_concept.hpp:46:35:
> warning: variable 'st' is uninitialized when used here [-Wuninitialized]
>            str->apply(*sp, *sp, *st);
>

Thanks. This is all in the concept checking and never called. Will see (and expect) if the disappear if we set the pointers to zero.

Regards, Barend


Sent from iPad.
Barend Gehrels
www.barendgehrels.nl_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Vishnu
Hi Barend,

The warning

/usr/devsrc/boost_1_47_0/boost/geometry/strategies/concepts/area_concept.hpp:52:13: warning: variable 'str' is uninitialized when used here [-Wuninitialized]
            str->apply(*sp, *sp, *st);

also shows up in the boost-geometry included with boost_1_47_0. Can the pointers be initialized with default values of 0 to eliminate the clang warning? The files generating the warnings are:

Files generating the error:
area_concept.hpp
within_concept.hpp
simplify_concept.hpp
distance_concept.hpp

Vishnu
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Mateusz Loskot
Administrator

Hi,
You've titled your post to Barend, but I guess Barend won't mind if I reply.

I agree, I'm sure it is good to fix the warnings.
ATM, I have no access to clang, so I missed these uninitialised values.

If you could provide patch, it would be very helpful.

--
Mateusz Loskot
(Sent from my mobile, so apology for top-posting or no quoting)


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Vishnu
I'll set the default values of the pointers to 0 and see if all my tests pass, which I should be the case if Barend's comment  ("this is all in the concept checking and never called") still holds. However, if anything has changed to invalidate that comment, please let me know.
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Mateusz Loskot
Administrator
On 11 January 2012 20:24, Vishnu <[hidden email]> wrote:
> I'll set the default values of the pointers to 0 and see if all my tests
> pass, which I should be the case if Barend's comment  ("this is all in the
> concept checking and never called") still holds. However, if anything has
> changed to invalidate that comment, please let me know.

IMHO, it doesn't hurt to have variables initialised, regardless where they are.
In some cases, it explicit initialisations hurt performance, but this
is not the case here.
I hope Barend will agree with me.

Once concepts make it into C++, then compilers will know to ignore such
uninitialized objects, but so far we have to help the compilers to
overcome their
lameness :)

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Barend
Hi,

On 11-1-2012 21:35, Mateusz Loskot wrote:

> On 11 January 2012 20:24, Vishnu<[hidden email]>  wrote:
>> I'll set the default values of the pointers to 0 and see if all my tests
>> pass, which I should be the case if Barend's comment  ("this is all in the
>> concept checking and never called") still holds. However, if anything has
>> changed to invalidate that comment, please let me know.
> IMHO, it doesn't hurt to have variables initialised, regardless where they are.
> In some cases, it explicit initialisations hurt performance, but this
> is not the case here.
> I hope Barend will agree with me.
>
> Once concepts make it into C++, then compilers will know to ignore such
> uninitialized objects, but so far we have to help the compilers to
> overcome their
> lameness :)

I agree, this is never called, so it does not hurt to initalize them.
However, 0 may sometimes (for ttmath) need to be written in another form
(either T() or an object), especially for ttmath. But go ahead, I will
solve that if it occurs.

Thanks, Barend


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Mateusz Loskot
Administrator
On 11 January 2012 20:54, Barend Gehrels <[hidden email]> wrote:

> On 11-1-2012 21:35, Mateusz Loskot wrote:
>>
>> On 11 January 2012 20:24, Vishnu<[hidden email]>  wrote:
>>>
>>> I'll set the default values of the pointers to 0 and see if all my tests
>>> pass, which I should be the case if Barend's comment  ("this is all in
>>> the
>>> concept checking and never called") still holds. However, if anything has
>>> changed to invalidate that comment, please let me know.
>>
>> IMHO, it doesn't hurt to have variables initialised, regardless where they
>> are.
>> In some cases, it explicit initialisations hurt performance, but this
>> is not the case here.
>> I hope Barend will agree with me.
>>
>> Once concepts make it into C++, then compilers will know to ignore such
>> uninitialized objects, but so far we have to help the compilers to
>> overcome their
>> lameness :)
>
>
> I agree, this is never called, so it does not hurt to initalize them.
> However, 0 may sometimes (for ttmath) need to be written in another form
> (either T() or an object), especially for ttmath. But go ahead, I will solve
> that if it occurs.

Oh, yes, I missed that. If templates are involved, T() should be used,
not raw Zero.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Vishnu
In reply to this post by Barend
I eliminated the clang warning by initializing *all* uninitialized pointers to 0 in these files:

area_concept.hpp
simplify_concept.hpp
within_concept.hpp
distance_concept.hpp

Can you make these changes in the next release of boost-geometry?
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Barend
Hi Vishnu,

Sure, right on time. For convenience, can you send those 4 files to me?
We're busy finishing for next release, for which we've only one day left
(plus one day for merging).

Thanks, Barend



On 13-1-2012 21:29, Vishnu wrote:

> I eliminated the clang warning by initializing *all* uninitialized pointers
> to 0 in these files:
>
> area_concept.hpp
> simplify_concept.hpp
> within_concept.hpp
> distance_concept.hpp
>
> Can you make these changes in the next release of boost-geometry?
>
> --
> View this message in context: http://boost-geometry.203548.n3.nabble.com/warnings-reported-by-Clang-tp2921152p3657642.html
> Sent from the Boost Geometry mailing list archive at Nabble.com.
> _______________________________________________
> Geometry mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/geometry
>


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Vishnu
Hi Barend,

The files are attached (there should be 4).

Vishnu

On Fri, Jan 13, 2012 at 12:32 PM, Barend Gehrels <[hidden email]> wrote:
Hi Vishnu,

Sure, right on time. For convenience, can you send those 4 files to me? We're busy finishing for next release, for which we've only one day left (plus one day for merging).

Thanks, Barend



On 13-1-2012 21:29, Vishnu wrote:
I eliminated the clang warning by initializing *all* uninitialized pointers
to 0 in these files:

area_concept.hpp
simplify_concept.hpp
within_concept.hpp
distance_concept.hpp

Can you make these changes in the next release of boost-geometry?

--
View this message in context: http://boost-geometry.203548.n3.nabble.com/warnings-reported-by-Clang-tp2921152p3657642.html
Sent from the Boost Geometry mailing list archive at Nabble.com.
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry



_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry

simplify_concept.hpp (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: warnings reported by Clang

Barend
Hi Vishnu,


On 13-1-2012 22:45, V Ranganathan wrote:
> Hi Barend,
>
> The files are attached (there should be 4).
>

(For others: the other 3 were sent off-list)

Thanks for your patches! They are committed now. Will be included in 1.49

Regards, Barend


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry