toxcore icon indicating copy to clipboard operation
toxcore copied to clipboard

Check return codes everywhere

Open elfring opened this issue 11 years ago • 9 comments

I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.

Would you like to add more error handling for return values from functions like the following?

elfring avatar Sep 23 '14 07:09 elfring

I suggest to avoid ignorance of return values a bit more. Would you like to detect every error situation as early as possible?

elfring avatar Oct 20 '15 05:10 elfring

closed for not having any activity in a year... reopened, sorry it got caught in crossfire

GrayHatter avatar Oct 20 '15 05:10 GrayHatter

Are you interested to apply aspect-oriented software development? How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?

elfring avatar Oct 20 '15 05:10 elfring

@elfring is there an AOP framework for C? Or does AspectC++ work for C code?

iphydf avatar Sep 22 '16 20:09 iphydf

is there an AOP framework for C?

How do you think about to look into the archives for corresponding approaches once more?

Or does AspectC++ work for C code?

elfring avatar Sep 22 '16 20:09 elfring

Ok, so https://github.com/TokTok/toxcore/pull/143 would solve the "However, the AspectC++ parser is a C++ parser and there are a few incompatibilities" issue. It generating C++ code means our code becomes effectively C++, and can no longer be compiled by simple C compilers. Right now, it seems that toxcore doesn't support platforms for which no C++ compiler exists, but the fact that it's written in C to begin with indicates an intention to support them.

Do you know whether the "pure C aspectc" that was planned for 2006 actually happened?

iphydf avatar Sep 22 '16 20:09 iphydf

The manual that comes with the most recent version (2016, 10 years later) says:

5.2.7 Support for Plain C Code
Currently ac++ generates C++ code, which cannot be compiled by a C compiler.
As for many hardware platforms in the embedded domain no C++ compiler is
available we are actively looking for a solution.

So I guess not. And I don't know what "actively looking for a solution" means anymore.

iphydf avatar Sep 22 '16 20:09 iphydf

And I don't know what "actively looking for a solution" means anymore.

translation: We posted about it on the internet once, and no one got back to us yet...

GrayHatter avatar Sep 23 '16 01:09 GrayHatter

How do you think about to influence the software evolution a bit more around development tools like "ACC" and "AspectC++"?

elfring avatar Sep 23 '16 07:09 elfring