CL 1876045 and CL 1871049 introduced signals SIGBUS and SIGSEGV to gc lex.c. SIGBUS is ...
13 years, 9 months ago
(2010-07-27 07:59:55 UTC)
#1
CL 1876045 and CL 1871049 introduced signals SIGBUS and SIGSEGV to gc lex.c.
SIGBUS is not always included in signal.h.
Microsoft Windows SDK and MinGW include the following set of signals in
signal.h: SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGTERM, SIGBREAK, and SIGABRT.
Therefore, on Windows, lex.c fails to compile with error "'SIGBUS' undeclared.
On 2010/07/27 08:00:57, PeterGo wrote: > Hello rsc (cc: mailto:golang-dev@googlegroups.com), > I second this. It ...
13 years, 9 months ago
(2010-07-27 10:44:58 UTC)
#3
On 2010/07/27 08:00:57, PeterGo wrote:
> Hello rsc (cc: mailto:golang-dev@googlegroups.com),
>
I second this. It fails on mingw. Don't know enough about the program to comment
on proposed remedy.
Alex
On Tue, Jul 27, 2010 at 5:44 AM, <alex.brainman@gmail.com> wrote: > On 2010/07/27 08:00:57, PeterGo ...
13 years, 9 months ago
(2010-07-28 16:19:59 UTC)
#4
On Tue, Jul 27, 2010 at 5:44 AM, <alex.brainman@gmail.com> wrote:
> On 2010/07/27 08:00:57, PeterGo wrote:
>>
>> Hello rsc (cc: mailto:golang-dev@googlegroups.com),
>
>
> I second this. It fails on mingw. Don't know enough about the program to
> comment on proposed remedy.
>
> Alex
>
> http://codereview.appspot.com/1903044/show
>
This may be nitpicking but what about:
#ifndef __WINDOWS__
signal(SIGBUS, fault);
#endif
-joe
I'll fix this today, without an #ifdef in that file. On Wed, Jul 28, 2010 ...
13 years, 9 months ago
(2010-07-28 18:38:52 UTC)
#5
I'll fix this today, without an #ifdef in that file.
On Wed, Jul 28, 2010 at 09:19, Joseph Poirier <jdpoirier@gmail.com> wrote:
> On Tue, Jul 27, 2010 at 5:44 AM, <alex.brainman@gmail.com> wrote:
>> On 2010/07/27 08:00:57, PeterGo wrote:
>>>
>>> Hello rsc (cc: mailto:golang-dev@googlegroups.com),
>>
>>
>> I second this. It fails on mingw. Don't know enough about the program to
>> comment on proposed remedy.
>>
>> Alex
>>
>> http://codereview.appspot.com/1903044/show
>>
>
> This may be nitpicking but what about:
>
> #ifndef __WINDOWS__
> signal(SIGBUS, fault);
> #endif
>
> -joe
>
Joe, This CL is a patch that I use which allows me to compile and ...
13 years, 9 months ago
(2010-07-28 20:28:48 UTC)
#6
Joe,
This CL is a patch that I use which allows me to compile and run lex.c on
Windows using MinGW and MSYS.
#include <signal.h>
#ifdef SIGBUS
signal(SIGBUS, fault);
#endif
signal(SIGSEGV, fault);
It recognizes that different systems recognize different signals; there is no
universal standard. It assumes that SIGSEGV is defined in <signal.h> on all
systems and SIGBUS may not be defined in <signal.h> on all systems
It does effectively assume that lex.c will be compiled and run on the same or a
similar system, which means that it's not fully portable. The signals available
at run-time are assumed to be the same as those found in <signal.h> at
compile-time.
Fortunately, I see Russ has come up with a better solution.
On 2010/07/28 16:19:59, Joe Poirier wrote:
> This may be nitpicking but what about:
#include <signal.h>
#ifndef __WINDOWS__
signal(SIGBUS, fault);
#endif
signal(SIGSEGV, fault);
This assumes that signal.h may be safely ignored when determining whether a
given signal is defined. It further assumes that all signal.h files on all
Windows systems conform, at least in part by defining __WINDOWS__, to the
copyrighted Microsoft Windows SDK C header files.
When I attempted to use your patch on Windows using MinGW and MSYS, it failed.
Peter
Issue 1903044: code review 1903044: gc lex: SIGBUS not always defined
Created 13 years, 9 months ago by peterGo
Modified 13 years, 9 months ago
Reviewers:
Base URL:
Comments: 0