Skip to content

Fix: replace non-standard 'uint' with 'size_t' in to_jpg.cpp#843

Merged
me-no-dev merged 1 commit intoespressif:masterfrom
swoboda1337:fix-uint-type
Mar 26, 2026
Merged

Fix: replace non-standard 'uint' with 'size_t' in to_jpg.cpp#843
me-no-dev merged 1 commit intoespressif:masterfrom
swoboda1337:fix-uint-type

Conversation

@swoboda1337
Copy link
Copy Markdown
Contributor

@swoboda1337 swoboda1337 commented Mar 25, 2026

ESP-IDF 6.0 ships GCC 15 and switches the default C library from Newlib to Picolibc. With Picolibc, uint is not defined as an implicit typedef (it's non-standard and was previously provided by <sys/types.h> on some platforms).

This causes a compilation error in conversions/to_jpg.cpp line 191:

error: 'uint' has not been declared; did you mean 'int'?

The file does include jpge.h which defines typedef unsigned int uint;, but that typedef is scoped inside namespace jpge and not visible at the point of use (the memory_stream class on line 191 is in the global namespace).

Changed to size_t to match the type of the max_len member that buf_size is assigned to.

@swoboda1337 swoboda1337 marked this pull request as draft March 25, 2026 14:49
@swoboda1337 swoboda1337 marked this pull request as ready for review March 25, 2026 14:51
GCC 15 (shipped with ESP-IDF 6.0) with Picolibc does not provide 'uint'
as an implicit typedef. This causes a compilation error on line 191.

The rest of the codebase uses a local typedef in jpge.h, but to_jpg.cpp
does not include that header. Use size_t to match the type of max_len
which buf_size is assigned to.
@swoboda1337 swoboda1337 changed the title Fix: replace non-standard 'uint' with 'unsigned int' in to_jpg.cpp Fix: replace non-standard 'uint' with 'size_t' in to_jpg.cpp Mar 26, 2026
@swoboda1337
Copy link
Copy Markdown
Contributor Author

This issue is currently blocking us from using IDF6. Thanks!

@me-no-dev me-no-dev merged commit c207156 into espressif:master Mar 26, 2026
@swoboda1337
Copy link
Copy Markdown
Contributor Author

Thanks!

@swoboda1337
Copy link
Copy Markdown
Contributor Author

When could we see a new release? IDF 6 support is broken until that happens. Thanks

@me-no-dev
Copy link
Copy Markdown
Member

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

Successfully merging this pull request may close these issues.

2 participants