All Questions
9,651 questions
1 vote
1 answer
45 views
Does GCC / cygwin C library support the c23 length modifiers wN and wfN for fprintf yet
I was trying to use the conversion specification %w32i to print an int32_t and an int_least32_t in seperate calls to fprintf I also tried to use the conversion specification %wf32i to print an ...
1 vote
1 answer
206 views
error: ‘format’ attribute argument 3 value ‘7’ does not refer to a variable argument list
There is a similar post but it doesn't help. The solution in that post is that it was a gcc bug which was fixed. Does gcc 15.2 has the bug again? I receive for the below code snapshot these error ...
Advice
0 votes
2 replies
86 views
Unmatched single quotation mark in argument to printf (in bash)
In the process of trying to learn about the different ways to manipulate text in bash (particularly when it comes to UTF-8 encoding) I came across this syntax somewhere (I don't remember exactly where ...
1 vote
1 answer
69 views
GCC+CMake, static lib changes size_t footprint
While refactoring some legacy code I ran into some strange behaviour of CMake+GCC that I can not explain or correct. This is what I have: Debian Trixie with GCC 14.2.0 and CMake 3.31.6 A test project ...
3 votes
5 answers
233 views
`printf` and `xargs` in a `for` loop
I want to produce this output: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 For that I created this script: (Based on https://stackoverflow.com/a/23961301/22133250) ...
2 votes
3 answers
167 views
Different outputs for the same line in C when another line is commented
In Clion, I was trying out format specifiers when I observed an interesting issue: When I run the following code: #include <stdio.h> int main() { printf("%f\n",5.0/4); printf(...
-1 votes
1 answer
277 views
Match() without wildcards on VBA arrays/Ranges
What is the best way to achieve behavior like WorksheetFunction.Match() in VBA, since this function is not quite suited to my purposes? I am looking for some native functionality that seeks a (String)...
0 votes
1 answer
221 views
Format() Entire Strings (Rather Than Characters)
Background VBA has a Format() function which converts any value to its textual representation. This is useful for numbers and Dates and times, but it can also be used on Strings. Debug.Print Format(&...
1 vote
1 answer
97 views
Printf command stops working when DEBUG trap is active?
When I set a DEBUG trap in Bash like this: set -o functrace trap 'echo "# $BASH_COMMAND" >&2' DEBUG Suddenly, this function stopped working: getBase() { local base="$1" ...
15 votes
3 answers
2k views
Why does a mismatching printf specifier also affect subsequent arguments?
I have a very simple C program where I am printing variables of different sizes. #include <stdio.h> unsigned int long long a; unsigned int c; int main() { a = 0x1111111122222222; c = ...
3 votes
1 answer
224 views
how to implement syscalls with newlib nano
im trying to implement syscalls for printf so i defined the functions : #include <stdint.h> #include <sys/stat.h> #include <sys/types.h> #include <errno.h> void usart_init(...
12 votes
4 answers
2k views
How does printing a union itself and not its member work in C?
I'm making a hashtable in C that I want to contain elements of different types, so I made it return a union that can hold int, float or char *. But when trying to print the union itself out, float ...
1 vote
1 answer
142 views
printf (inside C code) called from python in google colab. (no output)
printf doesn't output anything google colab cell: %%writefile my_functions.c #include <stdio.h> #include <stdlib.h> void my_void_func() { printf("my_void_func called from C!\n"); ...
3 votes
0 answers
272 views
Is it possible to disable some print format specifiers? the embedded system i'm working with does not support string output
logging interface is in the header https://gitee.com/openharmony/hiviewdfx_hilog_lite/blob/master/interfaces/native/kits/hilog_lite/hiview_log.h the comment in the header says that * @param fmt ...
0 votes
0 answers
72 views
Why is my Clang not checking the format string?
#include <stdio.h> //extern int printf(const char* __restrict, ...) __attribute__ ((format (printf, 1, 2))); void test_func(void); void test_func(void) { int test_object = 0; printf(&...