Whenever I build mingw-w64, I always get page after page of warning errors. All that noise makes it hard to find problems my changes have introduced. Rather than complain and hope someone else would fix it, I have made the changes myself (see attached patch or 'warn1.patch' on http://www.LimeGreenSocks.com/mingw-w64/Home.html if SF eats my attachment again). This work resulted in a few questions (which I hope someone can answer).

Q1: There are a lot of warnings due to the fact that most of the prototypes are declared with _CRTIMP (aka __declspec(dllimport)), but then a non-import version of the function is implemented. This conflict generates a warning. I currently fix this by adding CFLAGS='-D_CRTIMP=' to my configure command (ie define _CRTIMP as blank). But the real fix is either a) Change configure to always add this define during the build of mingw-w64 (which would make sense). b) For functions where we are implementing the method, remove the dllimport attribute on the prototype (which also seems like it makes sense).

Q2: There are 2 warnings left on my builds of x86/x64. IAMAsyncReaderTimestampScaling & IAMPluginControl in strmif.h are both tagged with __MINGW_BROKEN_INTERFACE. What needs to be done to 'test' an interface so this can be removed? Or to put this another way: What is there about these that is considered that much riskier than the rest of the code? I mean yeah, they might be broken, but anything 'might' be broken.

Q3: ARM is giving a bunch of warnings in the form: "dlltool.exe: Syntax error in def file .../mingw-w64-crt/libarm32/powerwmiprovider.def:62." I have looked at the def file, but I don't understand what I am seeing. How do I diagnose/repair this?

Q4: As of 3.8.0, clang (the only compiler I know that builds mingw-w64 for ARM) doesn't support __declspec(selectany) or __attribute__((gcc_struct)) on ARM. Since (essentially) no one is using this yet, can we assume it will get fixed before people will start using the library? Or must we code around it? Right now I'm doing a bit of both.

You can skip the rest of this post unless you have questions about the patch. Knowing *why* I made a change might avoid (or trigger) a question. If someone has comments, questions, or a better way, please let me know.

clog10.c, clog10f.c, clog10l.c:

 * The prototypes for the functions created in these files are
   protected by #ifdef _GNU_SOURCE.  Since we should always build the
   .c file, we need to add the define so we can find the prototype.

gs_support.c:

 * The minor variation causes a 'redefines' error.
 * ARM does not use StackCookie.  I'd like to use the already-defined
   __UNUSED_PARAM from _mingw.h, but it uses an attribute, so I'd have
   to put it on the function declaration, and then I'd have to #ifdef
   it by platform.  Yuck.

gai_strerrorA.c:

 * wcstombs() is in stdlib.

abs64.c:

 * llabs() is in stdlib.h.

cephes_emath.h:

 * The minor variations cause 'redefines' errors.

e_pow.c:

 * Sign mismatch in comparison.

ftw.c:

 * Unused parameters.

_vscprintf_p.c, _vscwprintf_p.c, _vswprintf_p.c:

 * _vscprintf_p_l, _vscwprintf_p_l & _vswprintf_p_l prototypes are
   protected by #if.  Add the define so we can find them.

mingw_pformat.c:

 * ARM does not support __attribute__((gcc_struct))

stdio.h:

 * We are shadowing a number of functions provided by the compiler
   (snprintf, vsnprintf, etc).  Ignore warnings.

uchar.h:

 * __STDC_UTF_16__ & __STDC_UTF_32__ are defined by the gcc compiler.

dxgi.h:

 * Cheap way to avoid 'redefine' errors.

aviriff.h, basetyps.h, combaseapi.h, gpedit.h:

 * Redefine errors.

mfapi.h:

 * Redefine errors.
 * FCC ('AI44') et al cause 'multichar' compiler warnings. Ignore them.

mfidl.h:

 * Redefine errors.

mftransform.h:

 * EXTERN_C is either defined as 'extern' or 'extern "C"'. However,
   this isn't really an extern (implying that the actual definition is
   elsewhere), since the code also initializes the variable.  And we
   don't need 'extern "C"' since this entire section is already wrapped
   with one.  Using both 'extern' and initializing generates a warning.

ntdef.h:

 * Redefine errors.

ntsecapi.h:

 * These redefine values that are unconditionally defined earlier in
   the same file.

winnt.h:

 * Redefine errors.

dw
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to