Author Topic: patch for build error with gcc-4.4.3 on linux  (Read 18257 times)

SpaceLifeForm

  • Guest
patch for build error with gcc-4.4.3 on linux
« on: March 19, 2012, 09:43:56 PM »
If you try to build the ScriptBasic interpreter with a newer gcc such as gcc-4.4.3,
you will encounter the following errors when compiling commands/function.c

commands/function.c: In function ‘COMMAND_GOSUB’:
commands/function.c:307: error: lvalue required as left operand of assignment
commands/function.c: In function ‘COMMAND_RETURNC’:
commands/function.c:327: error: lvalue required as left operand of assignment
commands/function.c: In function ‘COMMAND_POP’:
commands/function.c:349: error: lvalue required as left operand of assignment
commands/function.c: In function ‘COMMAND_EXITFUNC’:
commands/function.c:376: error: lvalue required as left operand of assignment

The reason is due to the usage of a typedef and a structure combination.

The patch reworks the code to avoid the problem.  It should be portable,
but has only been tested under Linux.

You can download the patch at <http://www.net-root.org/scriptbasic-patch>

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: patch for build error with gcc-4.4.3 on linux
« Reply #1 on: March 19, 2012, 10:20:54 PM »
Thanks for the patch and welcome to the ScriptBasic project.