-
Notifications
You must be signed in to change notification settings - Fork 51
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] Struct field naming contention with stdlib C/C++ header files struct_stat.h #defines in Linux. #50
Comments
Just to reiterate - this is an issue only when trying to compile for testing purposes. In a real-life situation would never attempt to use FreeRTOS-Plus-FAT with linux since it already has it's own file system drivers. But for consistency sake would appreciate renaming these values since they clash when used for debugging via cross compiling for native compiles and using the ff_stdio.h file from FreeRTOS-Plus-FAT. |
…t_ctime for linux.
Hi @phelter
I also worked on WIN32 when developing and testing FreeRTOS-Plus-FAT, so why not use it in the Linux port? It can be used as a FAT RAM-disk driver. Beside that: normally I would be happy to change struct fields, but in this case, many existing applications refer to Can you think of a downward compatible solution? Can we avoid the
|
No, unfortunately I went through the scenarios I don't see an alternative that is downward compatible. It's unfortunate that the names exist in I don't see this being a huge issue for updating if people are aware of the breaking change. The only thing that I can think of is if it is Linux - then define FF_STAT in the following manner: #ifdef (UNIX) // - or whatever port that uses sys/stat.h - might be POSIX based.
#include <sys/stat.h>
typedef struct stat FF_STAT;
#else
// Current definition
#endif So it's the exact same struct - and there is no duplication of the definition. Otherwise define something that is linux like but not use the same names. |
…f PR#49 (#51) * Adding in FF_SDDiskInitWithSettings optional initialization to support runtime initial mounting options. * FAT-#50: Fixing duplicate definition of st_atime, st_mtime, st_ctime for linux. * Fixing formatting with diff provided using uncrustify. --------- Co-authored-by: Paul Helter <paulheltera@gmail.com>
Describe the bug
When integrating
ff_stdio.h
with Unix x86_64-linux-gnu builds, there are multiple definitions of:st_atime, st_mtime, st_ctime
- These are defined in/usr/include/x86_64-linux-gnu/bits/struct_stat.h: Line 77-79
as macros:This conflicts with the definition of ff_stdio.h which uses the same name as these for parameters inside FF_Stat_t definition here
If you could please use another name for your time support for internal definitions so that it doesn't conflict with the naming in the stdlibs.
Target
Host
To Reproduce
Happens for
st_atime
,st_mtime
andst_ctime
.Expected behavior
No naming convention contention with stdlibs of C/C++.
Screenshots
N/A
Wireshark logs
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: