Closed anubhavcodes closed 9 years ago
There are no warnings on my side of make. However there are two new warnings on Travis CI, which can be fixed easily after I know your intention behind this static Workspace wss[] = { { NULL } , .... ... };
Did you want to assign the whole first member of wss as NULL, or the only the firstMember.layout as NULL?
Thanks for the PR, it looks good.
My intention was to have the first member of wss as NULL (howm counts workspaces from 1 so I wanted wss to be the same).
So I will have to make all the other values of the first member as NULL, I will do that.
Thanks neo, I'll merge this when it is done- great work!
This looks good, Travis reports no warnings for both clang and gcc. Thanks for doing this. :+1:
Wow clang was a complete suprise!! :)
For the discarding const pointer warning,term_cmd was const char _const, and we were trying to assign that to const char . So I changed the const char _cmd to a const char * const * const cmd Sounds confusing? Declare
cmd
as a const pointer to const pointer to const char, that's all we did and the warning disappears.For the other warning, initialization makes integer from pointer without a cast, initializing the first member of the wss[] array as NULL, was actually interpreted by the compiler as assigning the first member of the struct (which happens to be an int) to NULL, and NULL happens to be a pointer and hence NULL was not compatible with an int.
So changing the NULL value to 0 fixed the warning. I have tested the binary a little and there seems to be no crashes as of yet.
What I want to know is, you intention behind assigning the first member of the array wss[] as NULL? Were you trying to make all the members of the struct Workspace as NULL, or just the first member of ie int layout as NULL. If you were trying the former, we need to assign all the NULL eqvivalents of ints and unsigned ints there.
Now I should focus on the clang warnings.