• Signess issues in dxe3gen.c inhibits the compilation of the repository

    From [via djgpp@delorie.com]" @21:1/5 to All on Sun Mar 26 02:10:07 2023
    In /cvs/djgpp/djgpp/src/dxe/dxe3gen.c 2023/01/31 20:15:02 1.28
    the variables max_names and num_names are declared as unsigned int.
    Later at line 1323 in dxe3gen.c, num_names gets compared with n_exp_syms
    that is declared as LONG32 in dxe.h inhibiting the compilation of the
    current repository code. max_names and num_names are members of the
    struct opt defined in dxe3gen.c and n_exp_syms is a member of the
    struct dxe3_header defined in dxe.h.
    Modifying the signess of opt.num_names generates new signess
    issues like this:
    gcc -g -DDXE_CC=\"gcc\" -DDXE_AR=\"ar\" dxe3gen.c -o ../../hostbin/dxegen.exe gcc ... -c dxe3gen.c
    dxe3gen.c: In function `process_exp_file':
    dxe3gen.c:513: warning: comparison between signed and unsigned
    dxe3gen.c: In function `write_dxe':
    dxe3gen.c:1285: warning: comparison between signed and unsigned
    dxe3gen.c:1334: warning: comparison between signed and unsigned
    make[1]: *** [../makefile.inc:90: dxe3gen.o] Error 1
    make: *** [makefile:48: subs] Error 2

    Is there any reason for this difference in signess of the members
    of those structs if they shall be compared some where in the code?

    Regards,
    Juan M. Guerrero

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sun Mar 26 14:58:42 2023
    In /cvs/djgpp/djgpp/src/dxe/dxe3gen.c 2023/01/31 20:15:02 1.28
    the variables max_names and num_names are declared as unsigned int.
    Later at line 1323 in dxe3gen.c, num_names gets compared with n_exp_syms
    that is declared as LONG32 in dxe.h inhibiting the compilation of the
    current repository code. max_names and num_names are members of the
    struct opt defined in dxe3gen.c and n_exp_syms is a member of the
    struct dxe3_header defined in dxe.h.
    Modifying the signess of opt.num_names generates new signess
    issues like this:
    gcc -g -DDXE_CC=\"gcc\" -DDXE_AR=\"ar\" dxe3gen.c -o
    ../../hostbin/dxegen.exe
    gcc ... -c dxe3gen.c
    dxe3gen.c: In function `process_exp_file':
    dxe3gen.c:513: warning: comparison between signed and unsigned
    dxe3gen.c: In function `write_dxe':
    dxe3gen.c:1285: warning: comparison between signed and unsigned dxe3gen.c:1334: warning: comparison between signed and unsigned
    make[1]: *** [../makefile.inc:90: dxe3gen.o] Error 1
    make: *** [makefile:48: subs] Error 2

    Is there any reason for this difference in signess of the members
    of those structs if they shall be compared some where in the code?

    No, not really. You can avoid that warning at line 1323 like:

    - if (opt.num_names && opt.num_names != dh.n_exp_syms)
    + if (opt.num_names && opt.num_names != (ULONG32)dh.n_exp_syms)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)