Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built-in function arguments are not validated #10

Open
derrell opened this issue Jul 31, 2014 · 1 comment
Open

built-in function arguments are not validated #10

derrell opened this issue Jul 31, 2014 · 1 comment
Labels

Comments

@derrell
Copy link
Owner

derrell commented Jul 31, 2014

Issue by derrell
Wed Apr 30 14:55:56 2014
Originally opened as https://github.com/derrell/AppDeveloper/issues/46


The following, for example, generates an internal error. See the embedded comment. (See this in test x070).

include <stdio.h>
#include <stdlib.h>


int main(void)
{
    // Currently there is no argument validation for built-in functions. This
    // could be accomplished in any of three ways:
    //
    // 1. In each built-in function, valiliate number and types of variables
    //
    // 2. In the include() function, add a validate function to each entry of
    // the array (in addition to info and func), pass that validate function
    // to declarator.setBuiltin(), and call the validation function when the
    // built-in function is called.
    //
    // 3. Ultimately, implement a proper AST node wrapper around builtins,
    // which will allow them to be validated as with any non-builtin
    // function. (This, too, requires adding something to the array of
    // functions, so that the AST and symbol table entries can be built
    // correctly.)

    srand();
    return 0;
}
@derrell
Copy link
Owner Author

derrell commented Oct 27, 2014

The printf function already self-validates its arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant