[PATCH] Haiku gcc5 fixes (was: Re: [PATCH] C89)

François Revol <[email protected]> Tue, 28 Mar 2017 13:48:34 +0200
Newsgroups gmane.editors.qemacs.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------34602A607046B79EA444666E
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 28/03/2017 13:37, Fran=C3=A7ois Revol wrote:
> On 28/03/2017 13:16, Fran=C3=A7ois Revol wrote:
>> On 28/03/2017 12:29, Fran=C3=A7ois Revol wrote:
>>> Anyway, I'll just switch the recipe to gcc5.
>>>
>>
>> But now I need to fix the gcc5 warnings in the Haiku code :D
>
> For some reason GCC5 doesn't like qe_free() when used with a
> pointer-to-void in C++ code:
>
> In file included from haiku.cpp:24:0:
> haiku.cpp: In function 'void haiku_close(QEditScreen*)':
> qe.h:100:41: error: 'void*' is not a pointer-to-object type
>  #define qe_free(pp)    do { typeof(**(pp)) **__ =3D (pp); (free)(*__);
> *__ =3D NULL; } while (0)
>
>
> Obviously it tries to create an object of type void. I'm surprised it
> actually works in the C code...

There you go, this fixes the Haiku build with gcc5:
- force type in qe_free,
- link to C++ runtime as it's not automatic anymore.


Fran=C3=A7ois.

--------------34602A607046B79EA444666E
Content-Type: text/x-patch;
 name="qemacs-haiku-gcc5-fixes-20170329.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="qemacs-haiku-gcc5-fixes-20170329.patch"

Index: Makefile
===================================================================
RCS file: /sources/qemacs/qemacs/Makefile,v
retrieving revision 1.95
diff -u -r1.95 Makefile
--- Makefile	25 Mar 2017 18:00:52 -0000	1.95
+++ Makefile	28 Mar 2017 11:45:41 -0000
@@ -91,7 +91,7 @@
 
 ifdef CONFIG_HAIKU
   OBJS += haiku.o
-  LIBS += -lbe
+  LIBS += -lbe -lstdc++
 endif
 
 ifdef CONFIG_WIN32
Index: haiku.cpp
===================================================================
RCS file: /sources/qemacs/qemacs/haiku.cpp,v
retrieving revision 1.14
diff -u -r1.14 haiku.cpp
--- haiku.cpp	15 Mar 2017 07:24:31 -0000	1.14
+++ haiku.cpp	28 Mar 2017 11:45:42 -0000
@@ -329,7 +329,7 @@
     WindowState *ctx = (WindowState *)s->priv_data;
     ctx->w->Lock();
     ctx->w->Quit();
-    qe_free(&s->priv_data);
+    qe_free((WindowState **)&s->priv_data);
     uninit_application();
 }
 

--------------34602A607046B79EA444666E
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Qemacs-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/qemacs-devel

--------------34602A607046B79EA444666E--