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

Teddycloud 0.6.2 fails to compile (src/handler.c: In function 'readTrackPositions':) #237

Open
mfechner opened this issue Nov 4, 2024 · 5 comments

Comments

@mfechner
Copy link
Contributor

mfechner commented Nov 4, 2024

I currently work on teddycloud upgrade for FreeBSD from version 0.3.5 to 0.6.2.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282541

While compiling the new version I see the following error:

-e [ \033[0;32mCC\033[0m   ] \033[0;36msrc/handler.c\033[0m
In file included from include/handler.h:3,
                 from src/handler.c:1:
src/handler.c: In function 'readTrackPositions':
src/handler.c:510:29: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
  510 |                 TRACE_ERROR("Failed to seek track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                ~~~~~~~
      |                                                                                                 |
      |                                                                                                 size_t {aka long unsigned int}
src/cyclone/common/debug.h:66:50: note: in definition of macro 'TRACE_PRINTF_RESUME'
   66 | #define TRACE_PRINTF_RESUME(...) fprintf(stderr, __VA_ARGS__), osResumeAllTasks();
      |                                                  ^~~~~~~~~~~
src/handler.c:510:17: note: in expansion of macro 'TRACE_ERROR'
  510 |                 TRACE_ERROR("Failed to seek track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                 ^~~~~~~~~~~
src/handler.c:510:64: note: format string is defined here
  510 |                 TRACE_ERROR("Failed to seek track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
src/handler.c:517:29: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
  517 |                 TRACE_ERROR("Failed to read track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                ~~~~~~~
      |                                                                                                 |
      |                                                                                                 size_t {aka long unsigned int}
src/cyclone/common/debug.h:66:50: note: in definition of macro 'TRACE_PRINTF_RESUME'
   66 | #define TRACE_PRINTF_RESUME(...) fprintf(stderr, __VA_ARGS__), osResumeAllTasks();
      |                                                  ^~~~~~~~~~~
src/handler.c:517:17: note: in expansion of macro 'TRACE_ERROR'
  517 |                 TRACE_ERROR("Failed to read track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                 ^~~~~~~~~~~
src/handler.c:517:64: note: format string is defined here
  517 |                 TRACE_ERROR("Failed to read track position at %" PRIuSIZE " with error %s\r\n", filePos, error2text(error));
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
src/handler.c:524:29: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
  524 |                 TRACE_ERROR("Invalid OggS header at %" PRIuSIZE "\r\n", filePos);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~                  ~~~~~~~
      |                                                                         |
      |                                                                         size_t {aka long unsigned int}
src/cyclone/common/debug.h:66:50: note: in definition of macro 'TRACE_PRINTF_RESUME'
   66 | #define TRACE_PRINTF_RESUME(...) fprintf(stderr, __VA_ARGS__), osResumeAllTasks();
      |                                                  ^~~~~~~~~~~
src/handler.c:524:17: note: in expansion of macro 'TRACE_ERROR'
  524 |                 TRACE_ERROR("Invalid OggS header at %" PRIuSIZE "\r\n", filePos);
      |                 ^~~~~~~~~~~
src/handler.c:524:54: note: format string is defined here
  524 |                 TRACE_ERROR("Invalid OggS header at %" PRIuSIZE "\r\n", filePos);
      |                                                     ~^
      |                                                      |
      |                                                      unsigned int
      |                                                     %lu
src/handler.c:530:29: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
  530 |                 TRACE_ERROR("Invalid Opus Version %" PRIu8 " at %" PRIuSIZE "\r\n", buffer[4], filePos);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~                                           ~~~~~~~
      |                                                                                                |
      |                                                                                                size_t {aka long unsigned int}
src/cyclone/common/debug.h:66:50: note: in definition of macro 'TRACE_PRINTF_RESUME'
   66 | #define TRACE_PRINTF_RESUME(...) fprintf(stderr, __VA_ARGS__), osResumeAllTasks();
      |                                                  ^~~~~~~~~~~
src/handler.c:530:17: note: in expansion of macro 'TRACE_ERROR'
  530 |                 TRACE_ERROR("Invalid Opus Version %" PRIu8 " at %" PRIuSIZE "\r\n", buffer[4], filePos);
      |                 ^~~~~~~~~~~
src/handler.c:536:29: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
  536 |                 TRACE_ERROR("Invalid Header Type %" PRIu8 " at %" PRIuSIZE "\r\n", buffer[5], filePos);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~                                           ~~~~~~~
      |                                                                                               |
      |                                                                                               size_t {aka long unsigned int}
src/cyclone/common/debug.h:66:50: note: in definition of macro 'TRACE_PRINTF_RESUME'
   66 | #define TRACE_PRINTF_RESUME(...) fprintf(stderr, __VA_ARGS__), osResumeAllTasks();
      |                                                  ^~~~~~~~~~~
src/handler.c:536:17: note: in expansion of macro 'TRACE_ERROR'
  536 |                 TRACE_ERROR("Invalid Header Type %" PRIu8 " at %" PRIuSIZE "\r\n", buffer[5], filePos);
      |                 ^~~~~~~~~~~
cc1: all warnings being treated as errors
gmake: *** [Makefile:490: obj/src/handler.o] Error 1
*** Error code 1

The full build log is also available here:
https://pkg.fechner.net/data/141amd64-cicd/2024-11-04_17h16m06s/logs/errors/teddycloud-0.6.2.log

You have an idea how to fix this?

@SciLor
Copy link
Contributor

SciLor commented Nov 4, 2024

Redefine PRIuSIZE for your specific platform and/or compiler.

Maybe defining it by the type of size_t, so this always works.

@mfechner
Copy link
Contributor Author

mfechner commented Nov 4, 2024

@SciLor thanks a lot. I will try to get the libs patch upstream so the patches an be removed later.
Package does now compile.

mfechner added a commit to mfechner/teddycloud that referenced this issue Nov 4, 2024
@mfechner
Copy link
Contributor Author

mfechner commented Nov 4, 2024

@SciLor can you maybe update the dep: Oryx-Embedded/Common@8bdc41c
to at least version 2.4.0, this also includes a required modification.

@mfechner
Copy link
Contributor Author

mfechner commented Nov 5, 2024

Thanks, teddycloud 0.6.2 is now available for FreeBSD:
https://cgit.freebsd.org/ports/commit/?id=753f37087249da4f51266d10e1b7de53cc98bc64

@SciLor
Copy link
Contributor

SciLor commented Nov 5, 2024

Reopened until merged into stable

@SciLor SciLor reopened this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants