Skip to content
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

Compiling with clang: error: missing field 'flags' initializer [-Werror,-Wmissing-field-initializers] #39

Open
mtourne opened this issue Dec 9, 2014 · 5 comments

Comments

@mtourne
Copy link

mtourne commented Dec 9, 2014

I can get passed this previous compilation issue, mentioned here : #38

by running :
ERL_CFLAGS=-I/usr/local/Cellar/erlang/17.3.4/lib/erlang/erts-6.2.1/include rebar -v compile

Now I'm getting a bunch of errors along those lines :

INFO:  sh info:
    cwd: "/Users/mtourne/dev/yawndb/deps/ecirca"
    cmd: clang -c  -std=c99 -Wall -Wextra -Werror -pedantic -g -Wall -fPIC -I/usr/local/Cellar/erlang/17.3.4/lib/erlang/erts-6.2.1/include  c_src/ecirca_small.c -o c_src/ecirca_small.o
Compiling /Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c
/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:2756:19: error: missing field 'flags' initializer [-Werror,-Wmissing-field-initializers]
    {"new", 3, new},
                  ^
/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:2757:21: error: missing field 'flags' initializer [-Werror,-Wmissing-field-initializers]
    {"push", 2, push},
[...]
@superbobry
Copy link

This might be due to a change in Erlang NIF API, @si14 can you take a look?

@mtourne
Copy link
Author

mtourne commented Dec 9, 2014

I can add to the ERL_CFLAGS :
ERL_CFLAGS="-I/usr/local/Cellar/erlang/17.3.4/lib/erlang/erts-6.2.1/include -Wno-missing-field-initializers" rebar -v compile

and get to this new set of warnings :

/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:1342:1: error: unused function '_OSSwapInt16' [-Werror,-Wunused-function]
_OSSwapInt16(
^
/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:1351:1: error: unused function '_OSSwapInt32' [-Werror,-Wunused-function]
_OSSwapInt32(
^
/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:1366:1: error: unused function '_OSSwapInt64' [-Werror,-Wunused-function]
_OSSwapInt64(
^
/Users/mtourne/dev/yawndb/deps/ecirca/c_src/ecirca_small.c:1887:32: error: unused function 'enif_make_tuple1' [-Werror,-Wunused-function]
static __inline__ ERL_NIF_TERM enif_make_tuple1(ErlNifEnv* env,

@si14
Copy link
Member

si14 commented Dec 15, 2014

I'm sorry for a delay, I'm looking into the issue.

Looks like it's related to new rebar or GCC or both, because Travis builds repo just fine, but locally I can reproduce your warnings.

@si14
Copy link
Member

si14 commented Dec 15, 2014

OK, the first one set of warnings (missing-field) is because of new Erlang mechanism for dirty schedulers. According to release docs, it should be fine on 17.3 already, but I'll fix it.

Regarding #38 — right now I have no idea why this happens. It looks like compiler gets called twice, second time without necessary arguments. Investigating.

Regarding the last set of warnings — no idea yet, will fix.

BTW, what are your versions of Erlang and rebar?

@si14
Copy link
Member

si14 commented Dec 15, 2014

Can you please check if the project compiles for you now? It should do so, albeit with a couple of warnings.

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

No branches or pull requests

3 participants