all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
@ 2016-08-31  8:01 Angelo Graziosi
  2016-08-31 14:27 ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-08-31  8:01 UTC (permalink / raw)
  To: Emacs developers

Since there was the upgrade from GCC5 to GCC6 on MSYS2-MinGW64, the 
build log of Emacs (master) contains a lot of warnings like this:

[...]/work/emacs-master/nt/inc/ms-w32.h:296:17: warning: conflicting 
types for built-in function 'execve'

$ grep -c 'conflicting types' 
emacs-master-w64-x86_64-20160830_205442-release-build.log
134

Maybe you can silence them...


Thanks,
  Angelo.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31  8:01 Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64 Angelo Graziosi
@ 2016-08-31 14:27 ` Eli Zaretskii
  2016-08-31 15:01   ` Angelo Graziosi
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-08-31 14:27 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Wed, 31 Aug 2016 10:01:25 +0200
> 
> Since there was the upgrade from GCC5 to GCC6 on MSYS2-MinGW64, the 
> build log of Emacs (master) contains a lot of warnings like this:
> 
> [...]/work/emacs-master/nt/inc/ms-w32.h:296:17: warning: conflicting 
> types for built-in function 'execve'

Please show at least one such warning in its entirety.  I don't have
GCC 6.x here, so I cannot know what does it not like in our prototype.

Thanks.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 14:27 ` Eli Zaretskii
@ 2016-08-31 15:01   ` Angelo Graziosi
  2016-08-31 15:42     ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-08-31 15:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Il 31/08/2016 16:27, Eli Zaretskii ha scritto:
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Wed, 31 Aug 2016 10:01:25 +0200
>>
>> Since there was the upgrade from GCC5 to GCC6 on MSYS2-MinGW64, the
>> build log of Emacs (master) contains a lot of warnings like this:
>>
>> [...]/work/emacs-master/nt/inc/ms-w32.h:296:17: warning: conflicting
>> types for built-in function 'execve'
>
> Please show at least one such warning in its entirety.  I don't have
> GCC 6.x here, so I cannot know what does it not like in our prototype.

Oh yes, this is an example

make[2]: ingresso nella directory "/tmp/work/emacs-master/lib"
   CC       acl-errno-valid.o
   CCLD     ddeclient.exe
In file included from ../src/conf_post.h:32:0,

                  from ../src/config.h:1926,

                  from acl-errno-valid.c:20:

C:/msys64/tmp/work/emacs-master/nt/inc/ms-w32.h:296:17: warning: 
conflicting types for built-in function 'execve'

  extern intptr_t execve (const char *, char * const *, char * const *);

                  ^~~~~~

   CCLD     runemacs.exe
make[1]: uscita dalla directory "/tmp/work/emacs-master/nt"



The header ms-w32.h is included elsewhere and gives 134 of this warnings..

> Thanks.

Angelo



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 15:01   ` Angelo Graziosi
@ 2016-08-31 15:42     ` Eli Zaretskii
  2016-08-31 17:40       ` Angelo Graziosi
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-08-31 15:42 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Wed, 31 Aug 2016 17:01:08 +0200
> 
> > Please show at least one such warning in its entirety.  I don't have
> > GCC 6.x here, so I cannot know what does it not like in our prototype.
> 
> Oh yes, this is an example
> 
> make[2]: ingresso nella directory "/tmp/work/emacs-master/lib"
>    CC       acl-errno-valid.o
>    CCLD     ddeclient.exe
> In file included from ../src/conf_post.h:32:0,
> 
>                   from ../src/config.h:1926,
> 
>                   from acl-errno-valid.c:20:
> 
> C:/msys64/tmp/work/emacs-master/nt/inc/ms-w32.h:296:17: warning: 
> conflicting types for built-in function 'execve'
> 
>   extern intptr_t execve (const char *, char * const *, char * const *);
> 
>                   ^~~~~~
> 

Sigh... so unhelpful.

If you change the prototype in ms-w32.h to say this:

  extern intptr_t execve (const char *, char * const [], char * const []);

do these warnings go away?



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 15:42     ` Eli Zaretskii
@ 2016-08-31 17:40       ` Angelo Graziosi
  2016-08-31 18:11         ` Ken Brown
  2016-08-31 18:18         ` Eli Zaretskii
  0 siblings, 2 replies; 27+ messages in thread
From: Angelo Graziosi @ 2016-08-31 17:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Il 31/08/2016 17:42, Eli Zaretskii ha scritto:
>
> Sigh... so unhelpful.
>
> If you change the prototype in ms-w32.h to say this:
>
>   extern intptr_t execve (const char *, char * const [], char * const []);
>
> do these warnings go away?
>

Really I already did this with this simple test case:

$ cat test.c
#include <stdint.h>

/*extern intptr_t execve (const char *, char * const *, char * const *);*/
extern intptr_t execve (const char *, char * const [], char * const []);

int main()
{
   return 0;
}

$ gcc test.c
test.c:4:17: warning: conflicting types for built-in function ‘execve’
  extern intptr_t execve (const char *, char * const [], char * const []);


but always the warning... I doubt things change modifying ms-w32.h..

Angelo



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 17:40       ` Angelo Graziosi
@ 2016-08-31 18:11         ` Ken Brown
  2016-08-31 18:47           ` Eli Zaretskii
  2016-08-31 18:18         ` Eli Zaretskii
  1 sibling, 1 reply; 27+ messages in thread
From: Ken Brown @ 2016-08-31 18:11 UTC (permalink / raw)
  To: Angelo Graziosi, Eli Zaretskii; +Cc: emacs-devel

On 8/31/2016 1:40 PM, Angelo Graziosi wrote:
> $ cat test.c
> #include <stdint.h>
>
> /*extern intptr_t execve (const char *, char * const *, char * const *);*/
> extern intptr_t execve (const char *, char * const [], char * const []);
>
> int main()
> {
>   return 0;
> }
>
> $ gcc test.c
> test.c:4:17: warning: conflicting types for built-in function ‘execve’
>  extern intptr_t execve (const char *, char * const [], char * const []);

According to

   http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
   http://man7.org/linux/man-pages/man2/execve.2.html

you should include <unistd.h>, and the return type should be int.

Ken



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 17:40       ` Angelo Graziosi
  2016-08-31 18:11         ` Ken Brown
@ 2016-08-31 18:18         ` Eli Zaretskii
  2016-09-01 18:50           ` Richard Stallman
  1 sibling, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-08-31 18:18 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Wed, 31 Aug 2016 19:40:50 +0200
> 
> > If you change the prototype in ms-w32.h to say this:
> >
> >   extern intptr_t execve (const char *, char * const [], char * const []);
> >
> > do these warnings go away?
> >
> 
> Really I already did this with this simple test case:

I couldn't know you did that already, could I?

> $ cat test.c
> #include <stdint.h>
> 
> /*extern intptr_t execve (const char *, char * const *, char * const *);*/
> extern intptr_t execve (const char *, char * const [], char * const []);
> 
> int main()
> {
>    return 0;
> }
> 
> $ gcc test.c
> test.c:4:17: warning: conflicting types for built-in function ‘execve’
>   extern intptr_t execve (const char *, char * const [], char * const []);

Then I don't know what to do about this.  Since GCC doesn't show the
prototype of its built-in, I have no idea which part of the prototype
triggers the warning.  The above suggestion was taken straight out of
the MinGW64 headers, which is the best I can do.

Maybe ask on the MinGW64 forum about this.  They might be more privy
to GCC internals than I am.

Sorry.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 18:11         ` Ken Brown
@ 2016-08-31 18:47           ` Eli Zaretskii
  2016-08-31 19:56             ` Angelo Graziosi
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-08-31 18:47 UTC (permalink / raw)
  To: Ken Brown; +Cc: emacs-devel, angelo.graziosi

> Cc: emacs-devel@gnu.org
> From: Ken Brown <kbrown@cornell.edu>
> Date: Wed, 31 Aug 2016 14:11:41 -0400
> 
> According to
> 
>    http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
>    http://man7.org/linux/man-pages/man2/execve.2.html
> 
> you should include <unistd.h>, and the return type should be int.

Thanks.  On MS-Windows, execve is not declared in unistd.h, it's
declared in process.h (which we cannot include, because it conflicts
with our own process.h).  Nevertheless, doing what you suggest is
worth a try, since there are no other ideas.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 18:47           ` Eli Zaretskii
@ 2016-08-31 19:56             ` Angelo Graziosi
  2016-09-01  2:37               ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-08-31 19:56 UTC (permalink / raw)
  To: Eli Zaretskii, Ken Brown; +Cc: emacs-devel

Il 31/08/2016 20:47, Eli Zaretskii ha scritto:
>> Cc: emacs-devel@gnu.org
>> From: Ken Brown <kbrown@cornell.edu>
>> Date: Wed, 31 Aug 2016 14:11:41 -0400
>>
>> According to
>>
>>    http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
>>    http://man7.org/linux/man-pages/man2/execve.2.html
>>
>> you should include <unistd.h>, and the return type should be int.
>
> Thanks.  On MS-Windows, execve is not declared in unistd.h, it's
> declared in process.h (which we cannot include, because it conflicts
> with our own process.h).  Nevertheless, doing what you suggest is
> worth a try, since there are no other ideas.
>

As always, Ken's suggestions are right!

Now this test case,

$ cat test.c
/*#include <stdint.h>*/
#include <unistd.h>

/*extern intptr_t execve (const char *, char * const *, char * const *);*/
/*extern intptr_t execve (const char *, char * const [], char * const []);*/
extern int execve (const char *, char * const *, char * const *);

int main()
{
   return 0;
}

builds without warnings with

$ gcc -Wall test.c


BTW, I tried my first test case (that with the Emacs definition of 
'execve') with the other compilers in MSYS2/MinGW-64/32, and both MSYS2 
gcc 5.3 and MinGW64 gcc-6.1 give the warning, instead MinGW32 gcc-6.1 
does not print warnings.

Ciao,
Angelo.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 19:56             ` Angelo Graziosi
@ 2016-09-01  2:37               ` Eli Zaretskii
  2016-09-01  7:44                 ` Angelo Graziosi
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01  2:37 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: kbrown, emacs-devel

> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Wed, 31 Aug 2016 21:56:45 +0200
> Cc: emacs-devel@gnu.org
> 
> As always, Ken's suggestions are right!
> 
> Now this test case,
> 
> $ cat test.c
> /*#include <stdint.h>*/
> #include <unistd.h>
> 
> /*extern intptr_t execve (const char *, char * const *, char * const *);*/
> /*extern intptr_t execve (const char *, char * const [], char * const []);*/
> extern int execve (const char *, char * const *, char * const *);
> 
> int main()
> {
>    return 0;
> }
> 
> builds without warnings with
> 
> $ gcc -Wall test.c

Thanks.  What happens if you remove the unistd.h inclusion?



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01  2:37               ` Eli Zaretskii
@ 2016-09-01  7:44                 ` Angelo Graziosi
  2016-09-01 14:17                   ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-09-01  7:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kbrown, emacs-devel



Il 01/09/2016 04:37, Eli Zaretskii ha scritto:
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Wed, 31 Aug 2016 21:56:45 +0200
>> Cc: emacs-devel@gnu.org
>>
>> As always, Ken's suggestions are right!
>>
>> Now this test case,
>>
>> $ cat test.c
>> /*#include <stdint.h>*/
>> #include <unistd.h>
>>
>> /*extern intptr_t execve (const char *, char * const *, char * const *);*/
>> /*extern intptr_t execve (const char *, char * const [], char * const []);*/
>> extern int execve (const char *, char * const *, char * const *);
>>
>> int main()
>> {
>>    return 0;
>> }
>>
>> builds without warnings with
>>
>> $ gcc -Wall test.c
>
> Thanks.  What happens if you remove the unistd.h inclusion?
>

It builds without warnings. So the simplest test case is:


extern int execve (const char *, char * const *, char * const *);

int main()
{
   return 0;
}


Ciao, Angelo.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01  7:44                 ` Angelo Graziosi
@ 2016-09-01 14:17                   ` Eli Zaretskii
  2016-09-01 15:42                     ` Angelo Graziosi
                                       ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 14:17 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: kbrown, emacs-devel

> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 1 Sep 2016 09:44:59 +0200
> 
> > Thanks.  What happens if you remove the unistd.h inclusion?
> >
> 
> It builds without warnings. So the simplest test case is:
> 
> 
> extern int execve (const char *, char * const *, char * const *);
> 
> int main()
> {
>    return 0;
> }

Thanks, I made the changes on the master branch that are supposed to
fix the warnings.  Please test.

The prototype that fixes this, with 'int' as the return value, is
wrong, and is IMO a MinGW64 GCC bug which should be reported.
intptr_t is a 64-bit type in MinGW64, while int is still 32 bits.  By
enforcing the wrong type, GCC contradicts MinGW64's own library
headers.

Btw, another possibility to avoid the warnings would be to use the GCC
option -fno-builtin-execve.  Can you try that (with the previous
prototype)?



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 14:17                   ` Eli Zaretskii
@ 2016-09-01 15:42                     ` Angelo Graziosi
  2016-09-01 16:04                       ` Eli Zaretskii
  2016-09-01 16:25                     ` Angelo Graziosi
  2016-09-01 17:19                     ` Eli Zaretskii
  2 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-09-01 15:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kbrown, emacs-devel



Il 01/09/2016 16:17, Eli Zaretskii ha scritto:
>
> The prototype that fixes this, with 'int' as the return value, is
> wrong, and is IMO a MinGW64 GCC bug which should be reported.
> intptr_t is a 64-bit type in MinGW64, while int is still 32 bits.  By
> enforcing the wrong type, GCC contradicts MinGW64's own library
> headers.

I tested the test case (that using intptr_t) on OSX with gcc-6.1 and it 
prints the same warning only using 'int' as return type the warning goes 
away...



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 15:42                     ` Angelo Graziosi
@ 2016-09-01 16:04                       ` Eli Zaretskii
  2016-09-01 16:12                         ` Eli Zaretskii
                                           ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 16:04 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: kbrown, emacs-devel

> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 1 Sep 2016 17:42:06 +0200
> 
> > The prototype that fixes this, with 'int' as the return value, is
> > wrong, and is IMO a MinGW64 GCC bug which should be reported.
> > intptr_t is a 64-bit type in MinGW64, while int is still 32 bits.  By
> > enforcing the wrong type, GCC contradicts MinGW64's own library
> > headers.
> 
> I tested the test case (that using intptr_t) on OSX with gcc-6.1 and it 
> prints the same warning only using 'int' as return type the warning goes 
> away...

On Unix, execve indeed returns an int, because it's a process ID.  On
Windows, the return value can be a process handle, which is a 64-bit
data type on 64-bit Windows.  That is why the return value must be
intptr_t, not an int.

The bug in MinGW64 GCC is that it uses the Unix model for the builtin
execve, whereas it should have used the Windows model.

Anyway, if you don't believe me, look on MSDN:

  https://msdn.microsoft.com/en-us/library/hyw61wtd.aspx



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:04                       ` Eli Zaretskii
@ 2016-09-01 16:12                         ` Eli Zaretskii
  2016-09-01 16:14                         ` Angelo Graziosi
                                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 16:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, kbrown, angelo.graziosi

> Date: Thu, 01 Sep 2016 19:04:45 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
> 
> On Unix, execve indeed returns an int, because it's a process ID.

Sorry, that was wrong: it's an int error code, not a PID.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:04                       ` Eli Zaretskii
  2016-09-01 16:12                         ` Eli Zaretskii
@ 2016-09-01 16:14                         ` Angelo Graziosi
  2016-09-01 16:17                         ` Davis Herring
  2016-09-01 16:32                         ` Andreas Schwab
  3 siblings, 0 replies; 27+ messages in thread
From: Angelo Graziosi @ 2016-09-01 16:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kbrown, emacs-devel



Il 01/09/2016 18:04, Eli Zaretskii ha scritto:
>
> Anyway, if you don't believe me, look on MSDN:
>
>   https://msdn.microsoft.com/en-us/library/hyw61wtd.aspx
>

I haven't reasons to doubt...



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:04                       ` Eli Zaretskii
  2016-09-01 16:12                         ` Eli Zaretskii
  2016-09-01 16:14                         ` Angelo Graziosi
@ 2016-09-01 16:17                         ` Davis Herring
  2016-09-01 16:24                           ` Ken Brown
  2016-09-01 16:29                           ` Eli Zaretskii
  2016-09-01 16:32                         ` Andreas Schwab
  3 siblings, 2 replies; 27+ messages in thread
From: Davis Herring @ 2016-09-01 16:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, kbrown, Angelo Graziosi

> On Unix, execve indeed returns an int, because it's a process ID.  On
> Windows, the return value can be a process handle, which is a 64-bit
> data type on 64-bit Windows.  That is why the return value must be
> intptr_t, not an int.

No, it's an error code.  (You said as much for POSIX in your following 
message, but it's an error code on all systems.)  If it succeeds, the 
process image has been replaced and it doesn't return at all.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or 
too sparse, it is because mass-energy conversion has occurred during 
shipping.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:17                         ` Davis Herring
@ 2016-09-01 16:24                           ` Ken Brown
  2016-09-01 17:43                             ` Davis Herring
  2016-09-01 16:29                           ` Eli Zaretskii
  1 sibling, 1 reply; 27+ messages in thread
From: Ken Brown @ 2016-09-01 16:24 UTC (permalink / raw)
  To: Davis Herring, Eli Zaretskii; +Cc: emacs-devel, Angelo Graziosi

On 9/1/2016 12:17 PM, Davis Herring wrote:
>> On Unix, execve indeed returns an int, because it's a process ID.  On
>> Windows, the return value can be a process handle, which is a 64-bit
>> data type on 64-bit Windows.  That is why the return value must be
>> intptr_t, not an int.
>
> No, it's an error code.  (You said as much for POSIX in your following
> message, but it's an error code on all systems.)  If it succeeds, the
> process image has been replaced and it doesn't return at all.

The return value is not an error code.  If the function returns, it 
returns -1 and sets errno:

   http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
   https://msdn.microsoft.com/en-us/library/hyw61wtd.aspx

Ken




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 14:17                   ` Eli Zaretskii
  2016-09-01 15:42                     ` Angelo Graziosi
@ 2016-09-01 16:25                     ` Angelo Graziosi
  2016-09-01 16:30                       ` Eli Zaretskii
  2016-09-01 17:19                     ` Eli Zaretskii
  2 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2016-09-01 16:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kbrown, emacs-devel



Il 01/09/2016 16:17, Eli Zaretskii ha scritto:
>
> Btw, another possibility to avoid the warnings would be to use the GCC
> option -fno-builtin-execve.  Can you try that (with the previous
> prototype)?
>

I tested with the test case and it works: no warnings.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:17                         ` Davis Herring
  2016-09-01 16:24                           ` Ken Brown
@ 2016-09-01 16:29                           ` Eli Zaretskii
  1 sibling, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 16:29 UTC (permalink / raw)
  To: Davis Herring; +Cc: emacs-devel, kbrown, angelo.graziosi

> Cc: Angelo Graziosi <angelo.graziosi@alice.it>, kbrown@cornell.edu,
>         emacs-devel@gnu.org
> From: Davis Herring <herring@lanl.gov>
> Date: Thu, 1 Sep 2016 10:17:36 -0600
> 
> > On Unix, execve indeed returns an int, because it's a process ID.  On
> > Windows, the return value can be a process handle, which is a 64-bit
> > data type on 64-bit Windows.  That is why the return value must be
> > intptr_t, not an int.
> 
> No, it's an error code.  (You said as much for POSIX in your following 
> message, but it's an error code on all systems.)  If it succeeds, the 
> process image has been replaced and it doesn't return at all.

On Windows, the error code is returned from a function that can also
return a process handle.  Look in the MS CRT sources, and you will see
it.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:25                     ` Angelo Graziosi
@ 2016-09-01 16:30                       ` Eli Zaretskii
  2016-09-01 19:44                         ` Angelo Graziosi
  0 siblings, 1 reply; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 16:30 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: kbrown, emacs-devel

> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 1 Sep 2016 18:25:34 +0200
> 
> Il 01/09/2016 16:17, Eli Zaretskii ha scritto:
> >
> > Btw, another possibility to avoid the warnings would be to use the GCC
> > option -fno-builtin-execve.  Can you try that (with the previous
> > prototype)?
> >
> 
> I tested with the test case and it works: no warnings.

Thanks.  Not sure if we should use that alternative.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:04                       ` Eli Zaretskii
                                           ` (2 preceding siblings ...)
  2016-09-01 16:17                         ` Davis Herring
@ 2016-09-01 16:32                         ` Andreas Schwab
  2016-09-01 16:49                           ` Eli Zaretskii
  3 siblings, 1 reply; 27+ messages in thread
From: Andreas Schwab @ 2016-09-01 16:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, kbrown, Angelo Graziosi

On Sep 01 2016, Eli Zaretskii <eliz@gnu.org> wrote:

> Anyway, if you don't believe me, look on MSDN:
>
>   https://msdn.microsoft.com/en-us/library/hyw61wtd.aspx

execve != _execve.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:32                         ` Andreas Schwab
@ 2016-09-01 16:49                           ` Eli Zaretskii
  0 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 16:49 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel, kbrown, angelo.graziosi

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Angelo Graziosi <angelo.graziosi@alice.it>,  kbrown@cornell.edu,  emacs-devel@gnu.org
> Date: Thu, 01 Sep 2016 18:32:44 +0200
> 
> On Sep 01 2016, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > Anyway, if you don't believe me, look on MSDN:
> >
> >   https://msdn.microsoft.com/en-us/library/hyw61wtd.aspx
> 
> execve != _execve.

It is in MinGW.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 14:17                   ` Eli Zaretskii
  2016-09-01 15:42                     ` Angelo Graziosi
  2016-09-01 16:25                     ` Angelo Graziosi
@ 2016-09-01 17:19                     ` Eli Zaretskii
  2 siblings, 0 replies; 27+ messages in thread
From: Eli Zaretskii @ 2016-09-01 17:19 UTC (permalink / raw)
  To: angelo.graziosi; +Cc: kbrown, emacs-devel

> Date: Thu, 01 Sep 2016 17:17:35 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
> 
> The prototype that fixes this, with 'int' as the return value, is
> wrong, and is IMO a MinGW64 GCC bug which should be reported.
> intptr_t is a 64-bit type in MinGW64, while int is still 32 bits.  By
> enforcing the wrong type, GCC contradicts MinGW64's own library
> headers.

Actually, I see now that the prototype of execve in MinGW64 library
headers does match the builtin, and that of _execve doesn't (although
if the library function execve is called, it will call _execve).  So I
guess it's not a bug, strictly speaking, but a kludgey misfeature, and
a deviation from mingw.org's MinGW headers.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:24                           ` Ken Brown
@ 2016-09-01 17:43                             ` Davis Herring
  0 siblings, 0 replies; 27+ messages in thread
From: Davis Herring @ 2016-09-01 17:43 UTC (permalink / raw)
  To: Ken Brown; +Cc: Eli Zaretskii, emacs-devel, Angelo Graziosi

> The return value is not an error code.  If the function returns, it
> returns -1 and sets errno:

Sorry -- I borrowed the phrase from Eli's subsequent email, and (I 
think) we both meant "a return value indicating whether an error 
occurred".  For execve(), of course, it is simply "yes".

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or 
too sparse, it is because mass-energy conversion has occurred during 
shipping.



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-08-31 18:18         ` Eli Zaretskii
@ 2016-09-01 18:50           ` Richard Stallman
  0 siblings, 0 replies; 27+ messages in thread
From: Richard Stallman @ 2016-09-01 18:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, angelo.graziosi

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Really I already did this with this simple test case:

  > I couldn't know you did that already, could I?

It would have been better to say,

  That was good.  Too bad it didn't resolve the problem
  as we hoped it would.

I think you interpreted "Really I already did this with this simple
test case" as a rebuke to you: "Don't criticize me for not trying that
test case!  I DID try it!"

So you defended yourself by saying that you couldn't possibly
have known he had tried it.

That defense is valid -- but instead of defending yourself, it is much
better to praise/thank him for doing the right thing.

It will also defend you, because people will see you did not know he
had not tried that test.  Indeed, it will defend you _better_ than
what you actually said, because people will admire you for that
positivity and constructiveness.

I have had to learn to do this, over the years, and I have not learned
100%.  I still don't always manage to do it.  But I often do, and that
helps me get better outcomes.  You can learn too.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64
  2016-09-01 16:30                       ` Eli Zaretskii
@ 2016-09-01 19:44                         ` Angelo Graziosi
  0 siblings, 0 replies; 27+ messages in thread
From: Angelo Graziosi @ 2016-09-01 19:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: kbrown, emacs-devel



Il 01/09/2016 18:30, Eli Zaretskii ha scritto:
>> Cc: kbrown@cornell.edu, emacs-devel@gnu.org
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Thu, 1 Sep 2016 18:25:34 +0200
>>
>> Il 01/09/2016 16:17, Eli Zaretskii ha scritto:
>>>
>>> Btw, another possibility to avoid the warnings would be to use the GCC
>>> option -fno-builtin-execve.  Can you try that (with the previous
>>> prototype)?
>>>
>>
>> I tested with the test case and it works: no warnings.
>
> Thanks.  Not sure if we should use that alternative.
>

+1

Angelo



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-09-01 19:44 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-31  8:01 Too many warnings building Emacs with GCC 6 on MSYS2-MinGW64 Angelo Graziosi
2016-08-31 14:27 ` Eli Zaretskii
2016-08-31 15:01   ` Angelo Graziosi
2016-08-31 15:42     ` Eli Zaretskii
2016-08-31 17:40       ` Angelo Graziosi
2016-08-31 18:11         ` Ken Brown
2016-08-31 18:47           ` Eli Zaretskii
2016-08-31 19:56             ` Angelo Graziosi
2016-09-01  2:37               ` Eli Zaretskii
2016-09-01  7:44                 ` Angelo Graziosi
2016-09-01 14:17                   ` Eli Zaretskii
2016-09-01 15:42                     ` Angelo Graziosi
2016-09-01 16:04                       ` Eli Zaretskii
2016-09-01 16:12                         ` Eli Zaretskii
2016-09-01 16:14                         ` Angelo Graziosi
2016-09-01 16:17                         ` Davis Herring
2016-09-01 16:24                           ` Ken Brown
2016-09-01 17:43                             ` Davis Herring
2016-09-01 16:29                           ` Eli Zaretskii
2016-09-01 16:32                         ` Andreas Schwab
2016-09-01 16:49                           ` Eli Zaretskii
2016-09-01 16:25                     ` Angelo Graziosi
2016-09-01 16:30                       ` Eli Zaretskii
2016-09-01 19:44                         ` Angelo Graziosi
2016-09-01 17:19                     ` Eli Zaretskii
2016-08-31 18:18         ` Eli Zaretskii
2016-09-01 18:50           ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.