Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code clean up? #109

Open
mathog opened this issue Apr 21, 2020 · 4 comments
Open

Code clean up? #109

mathog opened this issue Apr 21, 2020 · 4 comments
Assignees

Comments

@mathog
Copy link

mathog commented Apr 21, 2020

When bowtie 1.2.3 (from sourceforge, presumably the same as here?) is compiled with a recent gcc (8.3.1) there are a lot of warnings. Can these be cleaned up at some point? All of those noise warnings obscure any warnings which may indicate an actual problem. Or maybe some of these do...

ebwt.h and blockwise_sa.h have a lot of "clause does not guard" warnings like this:

if(_fchr != NULL) delete[] _fchr; _fchr = NULL;

which should be changed to

if(_fchr != NULL) { delete[] _fchr; _fchr = NULL; }

diff_sample.h has two like this:

if(!diffs[d1]) diffCnt++; diffs[d1] = true;

where it wasn't clear to me if adding the braces is still OK. It would depend on if there is a later test of diffs[] of true vs. some other value.

There are a bunch of warnings in many modules about comparing ints of different signdedness. Typically those are harmless but sometimes not.

There are also a bunch like this:

edit.h:31:8: note: �struct Edit� declared here
 struct Edit {
        ^~~~
In file included from bowtie_inspect.cpp:8:
pool.h: In instantiation of �bool AllocOnlyPool<T>::lazyInit() [with T = Branch]�:
pool.h:215:7:   required from �T* AllocOnlyPool<T>::alloc() [with T = Branch]�
range_source.h:658:35:   required from here
pool.h:367:22: warning: �void* memset(void*, int, size_t)� clearing an object of non-trivial type �class Branch�; use assignment or value-initialization instead [-Wclass-memaccess]
    ASSERT_ONLY(memset(pool, 0, lim_ * sizeof(T)));
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
assert_helpers.h:21:27: note: in definition of macro �ASSERT_ONLY�

@ch4rr0 ch4rr0 self-assigned this Apr 22, 2020
@ch4rr0
Copy link
Collaborator

ch4rr0 commented Apr 22, 2020

My most recent commits to the bug_fixes branch should address these.

@mathog
Copy link
Author

mathog commented Apr 23, 2020 via email

@ch4rr0
Copy link
Collaborator

ch4rr0 commented Apr 23, 2020

These all happen in the destructor, there should be no worry about dangling values.

@mathog
Copy link
Author

mathog commented Apr 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants