[go: up one dir, main page]

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

Avoid dangling reference to temporary string object #1043

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

jmarshall
Copy link
Contributor

Clang produces the following warning for Fasta.cpp — and idx_path does indeed point to something no longer valid after the semicolon:

src/utils/Fasta/Fasta.cpp:38:28: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
    const char *idx_path = (fname + ".fai").c_str();
                           ^~~~~~~~~~~~~~~~

There are two other instances of the same warning, in BamAncillary.cpp, but that code is never used so doesn't matter too much.

@arq5x
Copy link
Owner
arq5x commented Apr 13, 2023

Thanks for fixing this, @jmarshall!

@arq5x arq5x merged commit 42e0aeb into arq5x:master Apr 13, 2023
@jmarshall jmarshall deleted the no-tmp-object branch April 13, 2023 01:26
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

Successfully merging this pull request may close these issues.

2 participants