[PATCH][ld] Implement --build-id=uuid on MinGW/MSYS2.

Igor Kudrin ikudrin@accesssoftek.com
Wed Jul 27 09:14:00 GMT 2016


Hi Thomas,

Thank you and sorry about that.
Here is the patch to fix the warnings, but I cannot apply it myself.

Best regards,
Igor Kudrin

---
ld/ChangeLog

	* ldbuildid.c (generate_build_id): Fix warning.

________________________________________
From: binutils-owner@sourceware.org <binutils-owner@sourceware.org> on behalf of Thomas Preudhomme <thomas.preudhomme@foss.arm.com>
Sent: Wednesday, July 27, 2016 2:40 PM
To: Igor Kudrin
Cc: binutils@sourceware.org; Alan Modra; Nick Clifton
Subject: Re: [PATCH][ld] Implement --build-id=uuid on MinGW/MSYS2.

Hi Igor,

Your commit d0d4152fa5c87532bf05007def680b5a536e1827 for this patch fails to
build because of the following warnings treated as errors:

src/binutils/ld/ldbuildid.c:155:36: error: comparison between signed and
unsigned integer expressions [-Werror=sign-compare]
src/binutils/ld/ldbuildid.c:155:59: error: signed and unsigned type in
conditional expression [-Werror=sign-compare]

Indeed, size is signed while sizeof is unsigned.

Best regards,

Thomas


On Tuesday 26 July 2016 13:31:37 Igor Kudrin wrote:
> Hi Alan,
>
> Thank you for the comments.
> Sorry about the formatting issues, here is an updated version of the patch.
>
> By the way, is there any formatting tool or official settings for tools like
> astyle or uncrustify?
>
> Best regards,
> Igor Kudrin
> ________________________________________
> From: Alan Modra <amodra@gmail.com>
> Sent: Tuesday, July 26, 2016 7:00 PM
> To: Igor Kudrin
> Cc: binutils@sourceware.org; Nick Clifton
> Subject: Re: [PATCH][ld] Implement --build-id=uuid on MinGW/MSYS2.
>
> On Mon, Jul 25, 2016 at 10:15:34AM +0000, Igor Kudrin wrote:
> > +#else /* __MINGW32__ */
> > +      UUID uuid;
> > +      typedef RPC_STATUS (RPC_ENTRY *UuidCreateFn)(UUID *Uuid);
>
> Formatting.  Space before open parens of function args.
>       typedef RPC_STATUS (RPC_ENTRY *UuidCreateFn) (UUID *Uuid);
>
> > +      UuidCreateFn uuid_create = 0;
> > +
> > +      HMODULE rpc_library = LoadLibrary("rpcrt4.dll");
>
> Same.
>       HMODULE rpc_library = LoadLibrary ("rpcrt4.dll");
>
> > +      if (!rpc_library)
> > +     return FALSE;
> > +      uuid_create = (UuidCreateFn)GetProcAddress(rpc_library,
> > "UuidCreate");
> Again, and space after cast.
>       uuid_create = (UuidCreateFn) GetProcAddress (rpc_library,
> "UuidCreate"); and more below.
>
> > +      if (!uuid_create)
> > +     {
> > +       FreeLibrary(rpc_library);
> > +       return FALSE;
> > +     }
> > +
> > +      if (uuid_create(&uuid) != RPC_S_OK)
> > +     {
> > +       FreeLibrary(rpc_library);
> > +       return FALSE;
> > +     }
> > +      FreeLibrary(rpc_library);
> > +      memcpy(id_bits, &uuid, size < sizeof(UUID) ? size : sizeof(UUID));
> > +#endif /* __MINGW32__ */
>
> Other than the formatting issues, I really don't have enough
> familiarity with mingw to properly review the patch.  So I'm passing
> the buck to Nick.
>
> --
> Alan Modra
> Australia Development Lab, IBM

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ld-build-id-uuid-warn.patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20160727/b214edec/attachment.txt>


More information about the Binutils mailing list