S
stephanearnold
Hello,
While writing an interpreter in C, I have thought of a suggestion for
some new keywords that would help to reduce C application complexity:
- nullable
- notnullable
I have a bunch of sept_get_XXX functions that return a pointer to a
struct, namely sept_Type*.
I have defined 'nullable' and 'notnullable' as empty macros in the
main .H file.
Now I defined my functions prototypes as follows:
inline notnullable sept_Type* sept_get_dict(void);
inline notnullable sept_Type* sept_get_list(void);
And I think I will use these macros in my source tree even for
function arguments, like this:
int my_func(nullable sept_Foo* foo, notnullable gchar* msg);
Why doesn't exist such a functionality in standard C/ or in specific
compilers?
Has my idea a chance to live, or is there no way to create such
keywords?
By the way, I have noticed they tend to make my source code difficult
to read,
but I will strive and continue to use it until I find a better way to
handle such informations.
Regards,
Stéphane A.
While writing an interpreter in C, I have thought of a suggestion for
some new keywords that would help to reduce C application complexity:
- nullable
- notnullable
I have a bunch of sept_get_XXX functions that return a pointer to a
struct, namely sept_Type*.
I have defined 'nullable' and 'notnullable' as empty macros in the
main .H file.
Now I defined my functions prototypes as follows:
inline notnullable sept_Type* sept_get_dict(void);
inline notnullable sept_Type* sept_get_list(void);
And I think I will use these macros in my source tree even for
function arguments, like this:
int my_func(nullable sept_Foo* foo, notnullable gchar* msg);
Why doesn't exist such a functionality in standard C/ or in specific
compilers?
Has my idea a chance to live, or is there no way to create such
keywords?
By the way, I have noticed they tend to make my source code difficult
to read,
but I will strive and continue to use it until I find a better way to
handle such informations.
Regards,
Stéphane A.