NULL handling

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_get_dict(void);
inline notnullable 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.
 
S

santosh

(e-mail address removed) wrote:

<repeat post snipped>

What was wrong with the responses to your first post of this question?
 
C

CBFalconer

santosh said:
(e-mail address removed) wrote:

<repeat post snipped>

What was wrong with the responses to your first post of this
question?

As seen here there was only one, accompanied by two more from
plonkees that were never allowed on my system. :)

Of course this still doesn't excuse the impatient re-entry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top