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

[BUG] stdio.h include nuttx/fs/fs.h nuttx/lib/lib.h Leading to duplicate definitions with third-party libraries #14260

Open
1 task done
anjiahao1 opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels
Arch: all Issues that apply to all architectures Area: Api API Issues Area: Build system

Comments

@anjiahao1
Copy link
Contributor

anjiahao1 commented Oct 14, 2024

Description / Steps to reproduce the issue

I have been using libarchive in nuttx, and everything was fine until stdio.h included the nuttx header file. There was a conflict between the header file in nuttx and libarchive. I think I should modify stdio.h so that stdio.h does not include any nuttx/*.h. I tried to delete nuttx/*.h but there were many compilation errors.

libarchive/libarchive/archive_read_open_filename.c:89:17: error: conflicting types for ‘file_read’; have ‘ssize_t(struct archive *, void *, const void **)’ {aka ‘long int(struct archive *, void *, const void **)’}
   89 | static ssize_t  file_read(struct archive *, void *, const void **buff);
      |                 ^~~~~~~~~
/home/ajh/work/archivefs/nuttx/include/nuttx/fs/fs.h:1426:9: note: previous declaration of ‘file_read’ with type ‘ssize_t(struct file *, void *, size_t)’ {aka ‘long int(struct file *, void *, long unsigned int)’}
 1426 | ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes);
      |         ^~~~~~~~~
libarchive/libarchive/archive_read_open_filename.c:90:17: error: conflicting types for ‘file_seek’; have ‘int64_t(struct archive *, void *, int64_t,  int)’ {aka ‘long int(struct archive *, void *, long int,  int)’}
   90 | static int64_t  file_seek(struct archive *, void *, int64_t request, int);
      |                 ^~~~~~~~~
/

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

ubunt24,04

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Api], [Area: Build System]

Verification

  • I have verified before submitting the report.
@github-actions github-actions bot added Arch: all Issues that apply to all architectures Area: Api API Issues Area: Build system labels Oct 14, 2024
@anjiahao1 anjiahao1 changed the title [BUG] <stdio.h include nuttx/fs/fs.h nuttx/lib/lib.h Leading to duplicate definitions with third-party libraries> [BUG] stdio.h include nuttx/fs/fs.h nuttx/lib/lib.h Leading to duplicate definitions with third-party libraries Oct 14, 2024
@anchao
Copy link
Contributor

anchao commented Oct 15, 2024

@Donny9 @GUIDINGLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: all Issues that apply to all architectures Area: Api API Issues Area: Build system
Projects
None yet
Development

No branches or pull requests

3 participants