String.h conflicts with <string.h> on case insensitive filesystems
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- cpp
- Lĩnh vực
- embedded-iot
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra src/core/api/IPAddress.cpp, include/core/api/Print.h và các include xung đột String.h và trong các đường dẫn include của Atmel Studio 7. Tái hiện lỗi CoreBuild đã được báo cáo và xác định cách các header đang được phân giải. Công việc được hoàn tất khi build bị ảnh hưởng phân giải đúng cả hai header và các hàm libc strlen, memcpy và memcmp khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The Arduino API renamed "WString.h" to "String.h"
Given that "string.h" is a part of libc, and that most modern operating systems implement sort of "fuzzy" case-matching in their filesystems, this seems ripe for generating confusion.
And in fact, it seems to break builds when sketches have been imported into Atmel Studio 7, if they use the ArduinoAPI - when ipaddress.cpp is built as part of the core, it includes both <string.h> and "String.h", and gets api/string.h for both of them, leaving the libc functions undefined:
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\ArduinoCore.cppproj" (target "Build" depends on it):
Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
Task "RunCompilerTask"
Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
Building file: ../src/core/api/IPAddress.cpp
Invoking: AVR8/GNU C Compiler : 5.4.0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-g++.exe" -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x0058 -DUSB_MANUFACTURER="\"Arduino LLC\"" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include" -I"..\include\core" -I"..\include\core\api" -I"..\include\core\api\deprecated" -I"..\include\core\api\deprecated-avr-comp\avr" -I"..\include\variants\nona4809" -Os -fno-threadsafe-statics -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -w -mmcu=atmega4809 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega4809" -c -std=gnu++11 -MD -MP -MF "src/core/api/IPAddress.d" -MT"src/core/api/IPAddress.d" -MT"src/core/api/IPAddress.o" -o "src/core/api/IPAddress.o" "../src/core/api/IPAddress.cpp"
In file included from ../src/core/api/IPAddress.cpp:21:0:
..\include\core\api/Print.h: In member function 'size_t Print::write(const char*)':
c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\include\core\api\Print.h(50,52): error: 'strlen' was not declared in this scope
return write((const uint8_t *)str, strlen(str));
^
../src/core/api/IPAddress.cpp: In constructor 'IPAddress::IPAddress(const uint8_t*)':
c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\src\core\api\IPAddress.cpp(43,59): error: 'memcpy' was not declared in this scope
memcpy(_address.bytes, address, sizeof(_address.bytes));
^
../src/core/api/IPAddress.cpp: In member function 'IPAddress& IPAddress::operator=(const uint8_t*)':
c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\src\core\api\IPAddress.cpp(90,59): error: 'memcpy' was not declared in this scope
memcpy(_address.bytes, address, sizeof(_address.bytes));
^
../src/core/api/IPAddress.cpp: In member function 'bool IPAddress::operator==(const uint8_t*) const':
c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\src\core\api\IPAddress.cpp(102,63): error: 'memcmp' was not declared in this scope
return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0;
^
make: *** [src/core/api/IPAddress.o] Error 1
c:\users\rnovaes\Documents\Atmel Studio\7.0\ArduinoSketch7\ArduinoSketch7\ArduinoCore\Debug\Makefile(243,1): error: recipe for target 'src/core/api/IPAddress.o' failed
There is some discussion here: https://www.avrfreaks.net/forum/7-compilation-error-arduino-nano-every-sketch
The exact problem may be that AS7 adds -I"..\include\core\api" that isn't needed (or used in an Arduino IDE build), but it does illustrate the sort of confusion that can/will occur.
- Ngôn ngữ chính
- C++
- Star
- 307
- Fork
- 152
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của arduino/ArduinoCore-API
-
Bit manipulation not working with 64 bit valuesCó thể đã có người làm @asumo-1xts đã nhận 36 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
arduino/ArduinoCore-API#261 ·
-
Missing virtual destructor for `Print` classCó thể đã có người làm @andreagilardoni đã nhận 1104 ngày trước. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 30/100
arduino/ArduinoCore-API#256 ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
arduino/ArduinoCore-API#251 · 1 bình luận ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
arduino/ArduinoCore-API#250 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
arduino/ArduinoCore-API#249 ·
Tất cả issue của arduino/ArduinoCore-API
Issue tương tự
-
agent:WSL bug linux LOW ui
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
ArduPilot/ardupilot#34617 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
tesseract-robotics/tesseract_nanobind#168 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Self-hosted runner Dockerfile pins actions/runner 2.327.1, below GitHub's new minimum (2.329.0)Đang mởauto-triaged bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/microsoft-ui-xaml#12158 ·
Maintainer thường phản hồi trong vòng 1 ngày