Skip to content

Doesn't compile with gcc 14 #1

@xbello

Description

@xbello

There are a lot of -Wincompatible-pointer-types when trying to do gz operations on a file pointer. E.g.

GLOBETROTTERCompanion.c: In function ‘data_read’:
GLOBETROTTERCompanion.c:191:7: error: assignment to ‘FILE *’ from incompatible pointer type ‘gzFile’ {aka ‘struct gzFile_s *’} [-Wincompatible-pointer-types]
  191 |   fd2 = gzopen(filenameSAMP,"r");
      |       ^
GLOBETROTTERCompanion.c:193:28: error: passing argument 1 of ‘gzgets’ from incompatible pointer  type [-Wincompatible-pointer-types]
  193 |   line_check=0; if (gzgets(fd2,line,2047)!=NULL) line_check=1;
      |                            ^~~
      |                            |
      |                            FILE *

Workaround: compile adding the flag no-incompatible-pointer-types after line #include "zlib.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"

Fix: change line 581 from

FILE *fd, *fd3, *fd2;

to

FILE *fd, *fd3;
gzFile fd2;

and change also line 157 from:

FILE *fd, *fd3, *fd2;

to

FILE *fd, *fd3;
gzFile fd2;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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