ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But I must ask... why in hell are you intentionally obfuscating the readability of the code with macro definitions? From a professional standpoint, it looks like crap. Don't get offended! It is merely my opinion, for which I am entitled to possess.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Why is function_t mentioned twice? I don't want to make an instance of function_t, if that's what it does.
Quote:
Originally Posted by dwhitney67
But I must ask... why in hell are you intentionally obfuscating the readability of the code with macro definitions? From a professional standpoint, it looks like crap. Don't get offended! It is merely my opinion, for which I am entitled to possess.
That's the best way I know of to achieve polymorphism in C. The idea is that all the contents of object_t are at the beginning of function_t, that way you can have an object_t pointer and treat it like an object_t, even if it's actually pointing to a function_t.
That fixed that issue. I didn't notice that the definition for function_t included function_t.
But now there's another one:
Code:
node_function.h:11:5: error: expected specifier-qualifier-list before ‘node_t’
node_function.h:14:70: error: expected declaration specifiers or ‘...’ before ‘node_t’
ast.c:143:30: error: incompatible types when assigning to type ‘jmp_buf’ from type ‘struct __jmp_buf_tag *’
ast.c:145:30: error: incompatible types when assigning to type ‘jmp_buf’ from type ‘struct __jmp_buf_tag *’
What does this mean? I read about it and heard that jmp_buf is actually an array, but why doesn't this work?
ast.c:143:30: error: incompatible types when assigning to type ‘jmp_buf’ from type ‘struct __jmp_buf_tag *’
ast.c:145:30: error: incompatible types when assigning to type ‘jmp_buf’ from type ‘struct __jmp_buf_tag *’
What does this mean? I read about it and heard that jmp_buf is actually an array, but why doesn't this work?
Copy-paste your code, including declaration of 'jmp_buf' and of '__jmp_buf_tag'.
What are you trying to do ? To assign to the whole array and not to array element ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.