libLAS / libLAS

C++ library and programs for reading and writing ASPRS LAS format with LiDAR data

Home Page:http://liblas.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3 * array bad compare

dcb314 opened this issue · comments

A new version of gcc compiler said 3 new things:

src/header.cpp:165:21: warning: comparison between two arrays [-Warray-compare]

Source code is

 if (m_signature != other.m_signature) return false;

src/header.cpp:171:20: warning: comparison between two arrays [-Warray-compare]

if (m_systemId != other.m_systemId) return false;

src/header.cpp:172:22: warning: comparison between two arrays [-Warray-compare]

if (m_softwareId != other.m_softwareId) return false;

Thanks. A small PR would be appreciated.

I have no idea what a PR is, but if you are asking me to fix the bug,
then this is probably unwise.

I don't know the code and I am likely to break it, rather than fixing anything.

Folks who know the code better are much better placed to fix it.

PR means Pull Request in GitHub speak.
You know the code. You referred to the actual where the issue happens.
If you know basics of C/C++, you can earn the hero badge very easily.

PR means Pull Request in GitHub speak.

I don't speak GitHub, so it doesn't mean anything to me.
No, I don't want to know what it does mean.

You know the code. You referred to the actual where the issue happens.

No again. I found a compiler warning message, that's all.

If you know basics of C/C++, you can earn the hero badge very easily.

I am apathetic about getting a hero badge.

May I refer you fine folks to my earlier comments ?

I am not going to fix it for you. I find bugs, project members fix them,
that's how I contribute to open source.

I am not going to fix it for you. I find bugs, project members fix them, that's how I contribute to open source.

😂

I am not going to fix it for you. I find bugs, project members fix them, that's how I contribute to open source.

😕 😞 😢

I don't want a hero badge either. Just sayin'.

Aforementioned lines have comparisons for mostly static const char values, namely FileSignature, SystemIdentifier, SoftwareIdentifier. These comparisons check for pointer equality and work as expectedly since compilers often use optimizations that reuse such strings even though it is not advisable.

Ways to go about it:

Here is an impl for the second solution which looks like an overkill imho.
Here is the draft impl for the third solution.

As I said, PRs are always welcome.

If you find libLAS valuable and would like to push its maintenance forward, then I'd say welcome to the team.