Skip to content

Conversation

@jcdr
Copy link
Contributor

@jcdr jcdr commented Oct 3, 2020

I use those C and C++ flags in my Makefile that trigg some compiler error:
FLAGS+=-Wall -Wextra -Wshadow -Werror -pedantic-errors -fdiagnostics-color -O6 -g
CFLAGS+=-std=gnu11 $(FLAGS)
CPPFLAGS+=-std=gnu++2a $(FLAGS)
The fixes allow to resolve the issues:
2 unused parameters
1 extra ;
1 timestamp.tv_ns not initialized

@Hadatko
Copy link
Member

Hadatko commented Oct 3, 2020

Thank you for the PR. Maybe you can update also makefiles with these flags within this commit. @MichalPrincNXP do you agree?

@jcdr
Copy link
Contributor Author

jcdr commented Oct 3, 2020

This will probably force to use the -std=gnu++2a flag that are maybe not available to everyone stuck with a not recent compiler for some reason. With only -std=gnu++11 the -Wpedantic-error flag cause this issue:

In static member function ‘static void erpc::Thread::sleep(uint32_t)’:
erpc/erpc_c/port/erpc_threading_pthreads.cpp:86:28: error: C++ designated initializers only available with -std=c++2a or -std=gnu++2a [-Wpedantic]
struct timespec rq = { .tv_sec = usecs / 1000000, .tv_nsec = (usecs % 1000000) * 1000 };
^

@jcdr
Copy link
Contributor Author

jcdr commented Oct 3, 2020

I have now a lot of issue like this:

In file included from erpc/erpcgen/src/types/Interface.h:13,
from erpc/erpcgen/src/SymbolScanner.h:17,
from erpc/erpcgen/src/SymbolScanner.cpp:11:
erpc/erpcgen/src/types/Function.h: In constructor ‘erpcgen::Function::Function(const erpcgen::Token&, erpcgen::Interface*)’:
erpc/erpcgen/src/types/Function.h:132:29: error: base ‘erpcgen::Symbol’ will be initialized after [-Werror=reorder]
, m_functionType(nullptr)
^
erpc/erpcgen/src/types/Function.h:132:29: error: base ‘erpcgen::FunctionBase’ [-Werror=reorder]
erpc/erpcgen/src/types/Function.h:127:5: error: when initialized here [-Werror=reorder]
Function(const Token &tok, Interface interface)
^~~~~~~~
erpc/erpcgen/src/types/Function.h: In constructor ‘erpcgen::Function::Function(const erpcgen::Token&, erpcgen::Interface, uint32_t)’:
erpc/erpcgen/src/types/Function.h:150:29: error: base ‘erpcgen::Symbol’ will be initialized after [-Werror=reorder]
, m_functionType(nullptr)
^
erpc/erpcgen/src/types/Function.h:150:29: error: base ‘erpcgen::FunctionBase’ [-Werror=reorder]
erpc/erpcgen/src/types/Function.h:145:5: error: when initialized here [-Werror=reorder]
Function(const Token &tok, Interface *interface, uint32_t uniqueId)
^~~~~~~~

Don't have time now to solve that kind of issue.

@jcdr
Copy link
Contributor Author

jcdr commented Oct 3, 2020

At least it now compile with the paranoid flags but the -Werror=reorder issue have to be solved before this could be merged.
Anyone have an idea on how to solve it ?

@jcdr
Copy link
Contributor Author

jcdr commented Oct 3, 2020

Ok, I finally find a way to fix the reorder issues. Probably require a careful check by someone else.
It compile on my machine, but maybe not on Travis.

@jcdr
Copy link
Contributor Author

jcdr commented Oct 4, 2020

Obviously, this is a more ambitious fix than initially expected...

[/home/travis/build/EmbeddedRPC/erpc/test/test_annotations/Linux/tcp/gcc/test_annotations_client/Debug/erpc_outputs/test/client.py] Segmentation fault (core dumped)

I doubt that I will continue that way. Someone that understand more deeply the internal logic could get some hints from this and make better choices to properly fix the issues.

@jcdr
Copy link
Contributor Author

jcdr commented Oct 4, 2020

I remastered everything into the pull request Paranoid #136

CBohler99 pushed a commit to VERO-Biotech/erpc that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants