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

Silence gcc warnings #973

Merged
merged 2 commits into from Nov 19, 2019
Merged

Silence gcc warnings #973

merged 2 commits into from Nov 19, 2019

Conversation

daviesrob
Copy link
Member

For some optimisation levels, gcc would report a format-truncation warning for the line that measured how much memory was needed to store the header string. Silence it by supplying a reasonably big buffer, which has the added bonus that the malloc and second call to vsnprintf can be avoided completely in most cases.

For some optimisation levels, gcc would report a format-truncation
warning for the line that measured how much memory was needed to
store the header string.  Silence it by supplying a reasonably
big buffer, which has the added bonus that the malloc and second
call to vsnprintf can be avoided completely in most cases.
Silence 'end' may be used uninitialized warning from gcc 4
by making it more obvious that EOF is returned when 'start' is
NULL (and 'end' is not used in that case).
@daviesrob
Copy link
Member Author

@pd3 reported another warning from gcc version 4. It looks like a false positive, but it's trivial to fix so I've added a commit to make it go away.

@daviesrob daviesrob changed the title Silence gcc warning in bcf_hdr_printf() Silence gcc warnings Nov 15, 2019
@whitwham whitwham merged commit 1579ace into samtools:develop Nov 19, 2019
@daviesrob daviesrob deleted the hdr_printf branch November 19, 2019 11: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.

None yet

2 participants