[PATCH] for SIGSEGV, compilation error in gcc 4.6

Charles Wilson cygwin@cwilson.fastmail.fm
Thu Feb 10 13:42:00 GMT 2011


On 2/10/2011 7:47 AM, jojelino wrote:
> On 2011-02-10 19:02, Corinna Vinschen wrote:
> 
>> Also, it would be nice if you would add more words to explain what your
>> patch is doing.  Just a patch with no explanation is not very inviting
>> to take a look at it at all.
> 
> this patch deals with only "two" problem. and this is "first" one.
> 
> static char * (*findenv_func)(const char *, int *) = (char *
> (*)(const char *, int *)) getearly;
> findenv_func is declared without __stdcall convention, and it is casting
> getearly having __stdcall convention with function type without
> __stdcall convention. to fix this problem, add __stdcall to findenv_func.

"two-liner"

+typedef char* (__stdcall *pfnenv)(const char*,int*);
...
-static char * (*findenv_func)(const char *, int *) = (char *
(*)(const char *, int *)) getearly;
+static pfnenv findenv_func = &getearly;


> and this is "another" one.
> 
> this one deals with compilation error that gcc 4.6 complained. so i just
> copy & paste __attribute__((regparm (x))) from function declaration to
> function definition, so i must admit that this one was derived from
> original cygwin source code. that is, you can fix it without this patch.

"mechanical repetition of one-liner"

I think this patch qualifies under the minor change rule for not needing
an assignment...although it would be good for the OP to go ahead and
complete the paperwork for future contributions.

IANAL, blah blah...

--
Chuck



More information about the Cygwin-patches mailing list