#300 new
Frank Barchard

macho-objfmt.c - pad_data string has different size warning

Reported by Frank Barchard | April 28th, 2016 @ 11:11 PM

When built with Visual C /GL option, macho-objfmt.c has a build warning:

warning C4743: '`string'' has different size in '...modules\objfmts\macho\macho-objfmt.c

Here is a patch with a fix:
diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c
index 1b00918..df91c32 100644
--- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1042,7 +1042,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, unsigned long fileoffset, fileoff_sections; yasm_intnum *val; unsigned long long_int_bytes; - const char pad_data[3] = "\0\0\0"; + const char pad_data[3] = { '\0', '\0', '\0' };

 info.object = object;
 info.objfmt_macho = objfmt_macho;

Comments and changes to this ticket

  • Frank Barchard

    Frank Barchard April 28th, 2016 @ 11:13 PM

    line feeds didnt work well in that report. Trying again

    diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c
    index 1b00918..df91c32 100644
    --- a/modules/objfmts/macho/macho-objfmt.c
    +++ b/modules/objfmts/macho/macho-objfmt.c
    @@ -1042,7 +1042,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms,
         unsigned long fileoffset, fileoff_sections;
         yasm_intnum *val;
         unsigned long long_int_bytes;
    -    const char pad_data[3] = "\0\0\0";
    +    const char pad_data[3] = { '\0', '\0', '\0' };
     
         info.object = object;
         info.objfmt_macho = objfmt_macho;
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Pages