Skip to content

compiler warning fscanf signed -> unsigned int #10

Description

@smoe

I know, it seems rather unlikely that that distances will exceed MAXINT/2 ... anyway.
Cheers,
Steffen

cc -g -O2 -fdebug-prefix-map=/home/moeller/git/med-team/quicktree/quicktree-2.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -Wunused-result -c -I./include -o ./sequence.o ./src/sequence.c
./src/distancemat.c: In function ‘read_phylip_DistanceMatrix’:
./src/distancemat.c:389:27: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘unsigned int *’ [-Wformat=]
  389 |   if (! fscanf( handle, "%d", &size ))
      |                          ~^   ~~~~~
      |                           |   |
      |                           |   unsigned int *
      |                           int *
      |                          %d
./src/distancemat.c:410:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  410 |     while(c = fgetc(handle)) {
      |           ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions