Open kaspar030 opened 4 years ago
https://github.com/RIOT-OS/RIOT/pull/15482 showed I'd missed some.
Can we include sched.h with <>
since it is "system" header?
Can we include sched.h with
<>
since it is "system" header?
"system" header would be headers that are in the compiler's default include paths, which RIOT's headers aren't.
Are you sure about the whole system header thing of <>
since acording to http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art026 its about local and then preconfigured (case " "
) path or just preconfigured path (case <>
). if you do not preconfigure to include the riot directories it will not be found in either case, if you preconfigure the RIOT include dirs it will be found in both cases but never in the local directory. The https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html is not very helpful since it uses the case of not additional preconfigured directory gcc min.c
aside from the system derectories
Obviously both "" and <>
will work fine in this case. In my mind RIOT is always an operating system so I would include the RIOT-provided headers just like how I include <linux/...>
or <sys/...>
in my applications. It is probably more about coding style in this case.
K&R could have saved us from this discusion if they just had not defined the fallback case for " "
it would have been you know the path -> " "
compiler has to search -> < >
K&R could have saved us from this discusion if they just had not defined the fallback case for
" "
it would have been you know the path ->
" "
compiler has to search ->< >
Yeah I was under the impression that we use "" for things we write ourselves and <>
for things we don't know/care where it is. Maybe I got that from some code style guidelines I used before. Can't remember exactly where...
Zephyr project does it that way https://github.com/zephyrproject-rtos/zephyr/blob/master/samples/hello_world/src/main.c
at least in that one example did not check other
Arduino has the same guideline: https://www.arduino.cc/reference/en/language/structure/further-syntax/include/
So - should I change?
So - should I change?
Thinking about it, I'm sorry, I just applied RIOT's convention in this change, not considering at all how ndn-riot is including files. Doing that, I didn't follow ndn-riot's previous style, causing inconsistency and discussion...
I pushed a fixup commit changing to <>
.
RIOT will soon drop the used kernel_types.h header. This PR updates ndn-riot to use the new location of the used kernel_pid_t.