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

[TW#12207] Discrepancy on macro definition values ARG_MAX and PATH_MAX #289

Closed
nkolban opened this issue Jan 23, 2017 · 3 comments
Closed

Comments

@nkolban
Copy link
Contributor

nkolban commented Jan 23, 2017

While compiling some 3rd party code, I found warnings about re-definitions of a couple of symbols, namely ARG_MAX and PATH_MAX. Searching ESP-IDF, I found both of these defined in components/newlib/include/limits.h and components/newlib/include/sys/syslimits.h.

In syslimits.h there are no redefinition guards. The values of the pairs of variables are not consistent. In one ARG_MAX = 4096 while in another ARG_MAX = 65536. And also PATH_MAX = 4096 while in the other PATH_MAX = 1024.

@lakidd
Copy link

lakidd commented Mar 19, 2017

Did you ever find a solution to this @nkolban ? I've got the same thing with the pcbreflux examples

@nkolban
Copy link
Contributor Author

nkolban commented Mar 20, 2017

Thankfully, the warnings are literally that ... warnings ... and other than not getting a pretty compile, all seems to function. Hopefully the folks at Espressif will continue to track this issue and in good time will offer us an "out of the box" fix. If you need an immediate workaround, I'd suggest picking one of the header files (probably syslimits.h) and comment out the duplicate symbols. This will produce a clean compile. The down-side is that when you bring in a new version of the ESP-IDF, the changes will be undone.

@lakidd
Copy link

lakidd commented Mar 21, 2017

Thanks, I added redefinition guards to syslimits.h and the warnings have gone. I thought it was causing some other issues but wasn't the case

@FayeY FayeY changed the title Discrepancy on macro definition values ARG_MAX and PATH_MAX [TW#12207] Discrepancy on macro definition values ARG_MAX and PATH_MAX May 2, 2017
@igrr igrr closed this as completed in 9f0dae4 May 5, 2017
igrr added a commit that referenced this issue May 5, 2017
FATFS fixes and tests

This MR includes a set of fixes related to FATFS, SDMMC, and wear levelling:

- `esp_vfs_fat_spiflash_mount` uses `FM_SFD` flag when creating the partition. The volume layout (given in `VolToPart` variable) was not compatible with SFD mode, so mkfs was failing. This fixes the volume layout to use "autodetect" for both volumes. Merges #559.

- fix `prepend_drive_to_path`function, which didn't prepend drive to path (while consuming 2k of stack space)

- fix stack overflow in vfs_fat_link function which allocated two 4kbyte `FIL` structures on the stack

- fix support for having two FATFS instances (in flash and SD) mounted at the same time

- unit tests written for FATFS on SDMMC are made common between SDMMC and WL implementations; FATFS unit tests on WL will run during CI

- fix inconsistent definition of PATH_MAX and ARG_MAX (TW12207, TW12104, #289)

See merge request !732
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

2 participants