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

a parameter list without types is only allowed in a function definition #163

Open
sgeto opened this issue Sep 7, 2017 · 5 comments
Open

Comments

@sgeto
Copy link

sgeto commented Sep 7, 2017

OS: Android 5.0
Architecture: armv7-a (32 bit)
Compiler: clang 4.0

Natively building openlibm on Android produces the following error:

➜  openlibm git:(master) make USECLANG=1
clang   -fno-builtin -mhard-float -O3 -fPIC -march=armv7-a -std=c99 -Wall -I/data/data/com.termux/files/home/openlibm -I/data/data/com.termux/files/home/openlibm/include -I/data/data/com.termux/files/home/openlibm/arm -I/data/data/com.termux/files/home/openlibm/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration -c src/s_cacos.c -o src/s_cacos.c.o
src/s_cacos.c:64:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
__strong_alias(cacosl, cacos);
^
src/s_cacos.c:64:16: error: a parameter list without types is only allowed in a function definition
__strong_alias(cacosl, cacos);
               ^
1 warning and 1 error generated.
make: *** [Make.inc:141: src/s_cacos.c.o] Error 1

Any ideas?

@valpackett
Copy link

valpackett commented Jul 12, 2018

Same is happening on FreeBSD armv6/7. (aarch64 works fine.) (clang is used on all archs.) __strong_alias is not defined in any headers, might be a compiler builtin thing?

@ViralBShah
Copy link
Member

@ararslan @iblis17 Might you know what is happening here?

@iblislin
Copy link
Contributor

iblislin commented Jul 15, 2018

I think it's __strong_reference on FreeBSD, (and the order of arguments are different)
here is a hack
https://gist.github.com/iblis17/6f340863fbb233a9326b0c4cbf035746

@valpackett
Copy link

Yes, __strong_reference is a thing (in sys/cdefs.h)

#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#ifndef __INTEL_COMPILER
#define	__strong_reference(sym,aliassym)	\
	extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
#endif
// …
#endif

Hmm, it could be the same on Android, since Bionic libc borrows a lot from *BSD libcs…

@ararslan
Copy link
Member

I don't know much about Android or ARM so I don't have a whole lot to contribute here, but some blind Googling suggests that Android may define both __strong_alias and __strong_reference as synonyms. At least that's the case in this Android development kit: https://github.com/crystax/android-platform-ndk/blob/master/sources/crystax/include/sys/cdefs.h#L103-L117.

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

5 participants