#1266 More support for constant functions


When assigning to a bit/logic variable inside a constant function, the RHS expression value must be trimmed to match the size of the variable.

1 Attachments


  • Martin Whitaker

    Martin Whitaker - 2013-03-09

    Pure functions with constant operands can be evaluated at compile time rather than at run time. This patch provides a global control to enable this optimisation. Until constant function support is complete, by default it is disabled.

  • Martin Whitaker

    Martin Whitaker - 2013-03-09

    This patch adds support for disable statements and system task calls in constant user functions. It also makes the checks for a function being constant work when the function contains nested scopes (named blocks).

    UPDATE: Removed white space error.

    Last edit: Martin Whitaker 2013-03-24
  • Martin Whitaker

    Martin Whitaker - 2013-03-09

    Here is a bundle of regression tests that check the above changes. All the tests are self-checking and need no special compiler flags.

  • Stephen Williams

    Applied to git master.

  • Stephen Williams

    • status: open --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks