8000 mrib.c: don't use cpu_to_be32 outside of function by cotequeiroz · Pull Request #2 · sbyx/omcproxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mrib.c: don't use cpu_to_be32 outside of function #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cotequeiroz
Copy link

cpu_to_be32 is not a constant, so it can't be used outside of a function.

Compilation fails on little-endian machines with:

[ 11%] Building C object CMakeFiles/omcproxy.dir/src/mrib.c.o
In file included from /var/lib/buildbot/slaves/slave-lede-builds4/mipsel_74kc/build/sdk/build_dir/target-mipsel_74kc_musl/omcproxy-2017-02-14-1fe6f48f/src/omcproxy.h:51:0,
                 from /var/lib/buildbot/slaves/slave-lede-builds4/mipsel_74kc/build/sdk/build_dir/target-mipsel_74kc_musl/omcproxy-2017-02-14-1fe6f48f/src/mrib.c:39:
/var/lib/buildbot/slaves/slave-lede-builds4/mipsel_74kc/build/sdk/build_dir/target-mipsel_74kc_musl/omcproxy-2017-02-14-1fe6f48f/src/mrib.c:57:34: error: braced-group within expression allowed only inside a function
 static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000);
                                  ^

Linux kernel defines __constant_cpu_to_be32 somewhere, but including its headers was messy. It is used only once, so it is simpler to just spell out the constant.

Signed-off-by: Eneas U de Queiroz cote2004-github@yahoo.com

cpu_to_be32 is not a constant, so it can't be used outside of a
function.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0