Skip to content

Compilation warnings with Clang #11

@Cyan4973

Description

@Cyan4973

Clang generates conversion warnings on compiling current master branch for linux 64-bits :

divsufsort.c:219:48: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
            if(0 <= c2) { BUCKET_B(c2, c1) = k - SA; }
                                           ~ ~~^~~~
divsufsort.c:243:26: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
        BUCKET_A(c2) = k - SA;
                     ~ ~~^~~~
divsufsort.c:283:48: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
            if(0 <= c2) { BUCKET_B(c2, c1) = k - SA; }

(...)

sssort.c:267:12: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
  t = last - first;
    ~ ~~~~~^~~~~~~
sssort.c:322:38: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
  for(ssize = 0, limit = ss_ilg(last - first);;) {
                         ~~~~~~ ~~~~~^~~~~~~
sssort.c:333:56: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
    if(limit-- == 0) { ss_heapsort(Td, PA, first, last - first); }

(...)

trsort.c:171:12: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
  t = last - first;
    ~ ~~~~~^~~~~~~
trsort.c:253:15: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
    if((s = a - first) > (t = b - a)) { s = t; }
          ~ ~~^~~~~~~
trsort.c:253:33: error: implicit conversion loses integer precision: 'long' to 'saidx_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
    if((s = a - first) > (t = b - a)) { s = t; }

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