Skip to content

Conversation

@kbingham
Copy link
Collaborator

The pisp_utils references std::string without directly pulling in the header.

Bring in the include explicitly to prevent compiler warnings.

This fixes compile issues I had while trying to build this in a bookworm container with GCC-12.
I'm surprised this came up, but perhaps it was something about the minimal configuration of the container.

Fixes:

[4/25] Compiling C++ object src/libpisp.so.1.1.0.p/libpisp_common_pisp_utils.cpp.o
FAILED: src/libpisp.so.1.1.0.p/libpisp_common_pisp_utils.cpp.o 
c++ -Isrc/libpisp.so.1.1.0.p -Isrc -I../src -Isrc/libpisp -I../src/libpisp -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -O3 -DPISP_LOGGING_ENABLE=0 -Wno-address-of-packed-member -fPIC -pthread -MD -MQ src/libpisp.so.1.1.0.p/libpisp_common_pisp_utils.cpp.o -MF src/libpisp.so.1.1.0.p/libpisp_common_pisp_utils.cpp.o.d -o src/libpisp.so.1.1.0.p/libpisp_common_pisp_utils.cpp.o -c ../src/libpisp/common/pisp_utils.cpp
../src/libpisp/common/pisp_utils.cpp:214:28: error: ‘string’ is not a member of ‘std’
  214 | static const std::map<std::string, uint32_t> &formats_table()
      |                            ^~~~~~
../src/libpisp/common/pisp_utils.cpp:16:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   15 | #include "logging.hpp"
  +++ |+#include <string>
   16 | 

The pisp_utils references std::string without directly pulling in
the <string> header.

Bring in the include explicitly to prevent compiler warnings.

Signed-off-by: Kieran Bingham <[email protected]>
@kbingham kbingham requested a review from naushir February 19, 2025 01:56
@naushir naushir merged commit 3f8164a into raspberrypi:main Feb 24, 2025
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