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

backend: Fix compiler error by missing cstdint include #23

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

ar90n
Copy link
Contributor

@ar90n ar90n commented Dec 29, 2023

Hi! I met similar compile error of #5 such as following.

$ meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /tmp/ww/libpisp/build
ninja: Entering directory `/tmp/ww/libpisp/build'
[3/4] Compiling C++ object src/libpisp.so.1.0.3.p/libpisp_backend_tiling_pipeline.cpp.o
FAILED: src/libpisp.so.1.0.3.p/libpisp_backend_tiling_pipeline.cpp.o
c++ -Isrc/libpisp.so.1.0.3.p -Isrc -I../src -Isrc/libpisp -I../src/libpisp -I../subprojects/nlohmann_json-3.11.2/single_include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -O3 -DPISP_LOGGING_ENABLE=0 -fPIC -pthread -MD -MQ src/libpisp.so.1.0.3.p/libpisp_backend_tiling_pipeline.cpp.o -MF src/libpisp.so.1.0.3.p/libpisp_backend_tiling_pipeline.cpp.o.d -o src/libpisp.so.1.0.3.p/libpisp_backend_tiling_pipeline.cpp.o -c ../src/libpisp/backend/tiling/pipeline.cpp
../src/libpisp/backend/tiling/pipeline.cpp: In member function ‘void tiling::Pipeline::Tile(void*, size_t, size_t, tiling::Length2*)’:
../src/libpisp/backend/tiling/pipeline.cpp:51:32: error: ‘uint8_t’ was not declared in this scope
   51 |                 void *y_src = (uint8_t *)mem + item_size * grid->dx * j;
      |                                ^~~~~~~
../src/libpisp/backend/tiling/pipeline.cpp:13:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   12 | #include "output_stage.hpp"
  +++ |+#include <cstdint>
   13 | #include "stages.hpp"
../src/libpisp/backend/tiling/pipeline.cpp:51:41: error: expected primary-expression before ‘)’ token
   51 |                 void *y_src = (uint8_t *)mem + item_size * grid->dx * j;
      |                                         ^
../src/libpisp/backend/tiling/pipeline.cpp:54:49: error: expected primary-expression before ‘)’ token
   54 |                         void *x_src = (uint8_t *)mem + item_size * i;
      |                                                 ^
../src/libpisp/backend/tiling/pipeline.cpp:55:48: error: expected primary-expression before ‘)’ token
   55 |                         void *dest = (uint8_t *)y_src + item_size * i;
      |                                                ^
../src/libpisp/backend/tiling/pipeline.cpp: In member function ‘int tiling::Pipeline::tileDirection(tiling::Dir, void*, size_t, size_t)’:
../src/libpisp/backend/tiling/pipeline.cpp:86:31: error: ‘uint8_t’ was not declared in this scope
   86 |                 void *dest = (uint8_t *)mem + num_tiles * item_size;
      |                               ^~~~~~~
../src/libpisp/backend/tiling/pipeline.cpp:86:31: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../src/libpisp/backend/tiling/pipeline.cpp:86:40: error: expected primary-expression before ‘)’ token
   86 |                 void *dest = (uint8_t *)mem + num_tiles * item_size;
      |                                        ^
../src/libpisp/backend/tiling/pipeline.cpp:68:44: error: unused parameter ‘mem’ [-Werror=unused-parameter]
   68 | int Pipeline::tileDirection(Dir dir, void *mem, size_t num_items, size_t item_size)
      |                                      ~~~~~~^~~
../src/libpisp/backend/tiling/pipeline.cpp:68:74: error: unused parameter ‘item_size’ [-Werror=unused-parameter]
   68 | int Pipeline::tileDirection(Dir dir, void *mem, size_t num_items, size_t item_size)
      |                                                                   ~~~~~~~^~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

To fix this error, I added #include <cstdint> to src/libpisp/backend/tiling/pipeline.cpp and then it seems that it works correctly.
Could you merge this PR ?

@naushir
Copy link
Collaborator

naushir commented Dec 30, 2023

Change looks reasonable. Could you update the commit message to follow the format of the other commit messages, i.e. have a header like "tiling: Add missing cstdint header", a small description, and a "Signed-off-by:" tag. Have a look at the git log to see some examples.

@ar90n
Copy link
Contributor Author

ar90n commented Dec 30, 2023

@naushir
Thanks for your reviewing. I changed my commit message to meet the format you said and added "Signed-off-by" tag.

@naushir naushir merged commit 7d49ac3 into raspberrypi:main Jan 1, 2024
6 of 7 checks passed
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