Skip to content

std=c99 required by gcc 4.8.5 #1523

Description

@lmjakt

I suspect that you may already be aware of the following, but if not perhaps it is useful to know:

I get the following errors and suggestions from gcc (4.8.5) when compiling hstlib, samtools or bcftools:

vcf.c:5109:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (int idx = 0; idx < sizeof(errdesc_bcf) / sizeof(err_desc); ++idx) {
     ^
vcf.c:5109:5: note: use option -std=c99 or -std=gnu99 to compile your code

they are solved by adding -std=gnu99 to the CFLAGS of the Makefiles of hstlib, samtools and bcftools.

I presume that this is specific to the version of gcc and hence not that important. Especially as it seems like there is a plan to specify std=c99 from looking at the htslib Makefile.

So this does not seem to be a problem per se, but I'm wondering whether there there is any potential problem with adding std=c99 or std=gnu99?

cheers,

Martin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions