Share

OnBoard C

Tracker: Bugs

5 Crash on bad func ptr typedef - ID: 1975498
Last Update: Settings changed ( boz_x )

Reported by Gareth on the Yahoo list.

...
Basically the line:

typedef Boolean (FormGadgetHandlerType) (struct FormGadgetType
*gadgetP, UInt16 cmd, void *paramP);

was causing the crash.

I changed it to

typedef Boolean (FormGadgetHandlerType*) (struct FormGadgetType
*gadgetP, UInt16 cmd, void *paramP);

and it compiled fine. It was definitely compile time not runtime.
...

My take on this is that this should be a callback declaration but instead
of being a function pointer, it's a regular function and this is probably
causing havoc. This really shouldn't crash if we can help it.


Lincoln Ramsay ( a1291762 ) - 2008-05-27 21:14

5

Open

None

Nobody/Anonymous

OnBoard C

OnBoard C

Public


Comment ( 1 )




Date: 2008-05-28 09:27
Sender: boz_xProject AdminAccepting Donations


As far as I'm aware, the original version:
typedef Boolean (FormGadgetHandlerType) (struct FormGadgetType
*gadgetP, UInt16 cmd, void *paramP);

is not legal C. As such, we should return a parser error & bail out.

Definitely shouldn't cause a crash though!

Hopefully not too tough to fix, either way...


Log in to comment.

Attached File

No Files Currently Attached

Change ( 1 )

Field Old Value Date By
summary Crash on this code. 2008-05-28 09:32 boz_x