On Thu, 2024-01-04 17:28:02 +0100, Georg-Johann Lay wrote: > This fixes the avr-specific attributes io, io_low and address, > that are all basically the same except that io and io_low imply > assertions on allowed addressing modes. > --- a/gcc/config/avr/avr.cc > +++ b/gcc/config/avr/avr.cc [...] > @@ -10385,12 +10389,10 @@ avr_handle_addr_attribute (tree *node, tree name, tree args, > } > else if (io_p > && (!tree_fits_shwi_p (arg) > - || !(strcmp (IDENTIFIER_POINTER (name), "io_low") == 0 > - ? low_io_address_operand : io_address_operand) > - (GEN_INT (TREE_INT_CST_LOW (arg)), QImode))) > + || ! IN_RANGE (TREE_INT_CST_LOW (arg), io_start, io_end))) > { > - warning_at (loc, OPT_Wattributes, "%qE attribute address " > - "out of range", name); > + warning_at (loc, OPT_Wattributes, "%qE attribute address out of " > + "range 0x%x...0x%x", name, (int) io_start, (int) io_end); > *no_add = true; > } > else Building with a recent GCC, this results in a new warning (here forced to an error with --enable-werror-alway--enable-werror-always): /var/lib/laminar/run/gcc-avr-elf/64/local-toolchain-install/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o avr.o -MT avr.o -MMD -MP -MF ./.deps/avr.TPo ../../gcc/gcc/config/avr/avr.cc ../../gcc/gcc/config/avr/avr.cc: In function 'tree_node* avr_handle_addr_attribute(tree_node**, tree, tree, int, bool*)': ../../gcc/gcc/config/avr/avr.cc:10391:45: error: unquoted sequence of 3 consecutive punctuation characters '...' in format [-Werror=format-diag] 10391 | warning_at (loc, OPT_Wattributes, "%qE attribute address out of " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 10392 | "range 0x%x...0x%x", name, (int) io_start, (int) io_end); | ~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[1]: *** [Makefile:2554: avr.o] Error 1 make[1]: Leaving directory '/var/lib/laminar/run/gcc-avr-elf/64/toolchain-build/gcc' make: *** [Makefile:4676: all-gcc] Error 2 I think this should be "%<...%>". MfG, JBG --