OS X Compilation (again!)

Olly Betts olly at survex.com
Fri Jan 17 07:49:05 GMT 2014


On Thu, Jan 16, 2014 at 09:44:09PM +0000, Olly Betts wrote:
> On Wed, Jan 15, 2014 at 09:56:22PM -0500, David A. Riggs wrote:
> > gcc -arch i386 -DHAVE_CONFIG_H -I. -I..    -Wall -W -Wunused -Wshadow -Wpointer-arith      -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wnested-externs      -Wcast-align -g -O2 -MT cad3d.o -MD -MP -MF .deps/cad3d.Tpo -c -o cad3d.o cad3d.c
> > cad3d.c:202:10: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
> >    layer = layer;
> >    ~~~~~ ^ ~~~~~
> 
> These are all harmless (ironically, the self-assignment is a common
> idiom to avoid an "unused function parameter" warning).

I've changed all these cases to use a cast to void, which should make these
warnings go away.

> > In file included from moviemaker.cc:59:
> > ./moviemaker.h:30:22: warning: private field 'oc' is not used [-Wunused-private-field]
> >     AVFormatContext *oc;
> >                      ^
[...]
> 
> This is probably due to not having libav (or libffmpeg) installed.  If
> that's the case, these are harmless warnings (but you won't be able to
> export movies).

These should be gone too.

> > /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/wxcrt.h:577:14: error: call to 'wcsstr' is ambiguous
> >     { return wxCRT_StrstrW(haystack, needle); }
> >              ^~~~~~~~~~~~~
> > /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/wxcrtbase.h:155:26: note: expanded from macro 'wxCRT_StrstrW'
> > #define wxCRT_StrstrW    wcsstr
> >                          ^~~~~~
> > /usr/include/wchar.h:141:10: note: candidate function
> > wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
> >          ^
> 
> I'll have to take a look at the wx 3.0 headers, which aren't on this
> machine.  Hopefully not hard to fix, though it might be a wx bug rather
> than one in Survex.

Looking more closely I think it might actually be a bug in OS X - the
libc++ headers and the C library headers have different prototypes for
wcsstr() (one has __restrict qualifiers, one doesn't), and if you end
up with both visible, that can result this error.

I suspect including the wx headers first from the file in question will
fix this - either build the latest git version, or apply the attached
patch, and let me know what the result is.

Cheers,
    Olly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: survex-osx9.patch
Type: text/x-diff
Size: 1002 bytes
Desc: not available
URL: <http://lists.survex.com/pipermail/survex/attachments/20140117/340acd46/attachment.patch>


More information about the Survex mailing list