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

Implicit declaration of fileno in vfprintf_s.c #136

Open
mschulz-at-hilscher opened this issue Apr 9, 2024 · 4 comments
Open

Implicit declaration of fileno in vfprintf_s.c #136

mschulz-at-hilscher opened this issue Apr 9, 2024 · 4 comments

Comments

@mschulz-at-hilscher
Copy link
Contributor

When compiling with an arm-eabi compiler, I get the following error:

In file included from io/vfprintf_s.c:36:0:
io/vfprintf_s.c: In function ‘vfprintf_s’:
io/vfprintf_s.c:82:18: error: implicit declaration of function ‘fileno’; did you mean ‘mblen’? [-Werror=implicit-function-declaration]
     if (unlikely(fileno(stream) < 0)) {
                  ^
./safeclib_private.h:174:48: note: in definition of macro ‘_expect’
 #define _expect(expr, value) __builtin_expect((expr), (value))
                                                ^~~~
io/vfprintf_s.c:82:9: note: in expansion of macro ‘unlikely’
     if (unlikely(fileno(stream) < 0)) {
         ^~~~~~~~
io/vfprintf_s.c:82:18: error: nested extern declaration of ‘fileno’ [-Werror=nested-externs]
     if (unlikely(fileno(stream) < 0)) {
                  ^
./safeclib_private.h:174:48: note: in definition of macro ‘_expect’
 #define _expect(expr, value) __builtin_expect((expr), (value))
                                                ^~~~
io/vfprintf_s.c:82:9: note: in expansion of macro ‘unlikely’
     if (unlikely(fileno(stream) < 0)) {
         ^~~~~~~~
@rurban
Copy link
Owner

rurban commented Apr 9, 2024

Which compiler exactly? Which header is missing?

@mschulz-at-hilscher
Copy link
Contributor Author

mschulz-at-hilscher commented Apr 10, 2024

It seems like our embedded system does not support certain posix functions by default such as fileno and ftruncate. Maybe that is something that could be checked during the configure run.

In the end, we are using the gcc compiler from ecospro (https://www.ecoscentric.com/ecos/ecospro.shtml) and its c library.

@rurban
Copy link
Owner

rurban commented Apr 10, 2024

Oh, I see. Will add probes then

@jleffler
Copy link

jleffler commented Apr 10, 2024 via email

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