Timeline for Where in the C standard does it specify the corresponding argument for %n in fscanf shall be a pointer to int
Current License: CC BY-SA 4.0
Post Revisions
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| 20 hours ago | audit | First questions | |||
| 20 hours ago | |||||
| Apr 21 at 14:36 | audit | First questions | |||
| Apr 21 at 14:36 | |||||
| Apr 21 at 6:21 | comment | added | Peter Cordes |
There'd be no way for sscanf to infer the size of the pointed-to integer type, so there does have to be a single valid size. The asm calling convention for variadic functions applies the "usual argument promotions" (which doesn't do anything to pointers), then passes them unchanged. No extra parameters that specify anything about types. Your experiment successfully demonstrated that the (default) size is smaller than long long (64-bit) on your system. I would've used %llx to print (uint64_t)n, to get an output like 0xFFFFFFFF00000003 clearly showing a little-endian narrow write.
|
|
| Apr 21 at 3:13 | audit | First questions | |||
| Apr 21 at 3:23 | |||||
| Apr 21 at 3:11 | audit | First questions | |||
| Apr 21 at 3:23 | |||||
| Apr 19 at 14:28 | history | edited | dbush |
edited tags
|
|
| Apr 19 at 10:01 | history | became hot network question | |||
| Apr 19 at 3:34 | history | edited | wohlstad | CC BY-SA 4.0 |
added 10 characters in body
|
| Apr 18 at 22:39 | history | edited | timmy george | CC BY-SA 4.0 |
deleted 32 characters in body; edited title
|
| Apr 18 at 20:24 | vote | accept | timmy george | ||
| Apr 18 at 20:18 | answer | added | Andreas Wenzel | timeline score: 9 | |
| Apr 18 at 20:12 | history | edited | timmy george | CC BY-SA 4.0 |
added 13 characters in body
|
| Apr 18 at 20:07 | answer | added | dbush | timeline score: 19 | |
| Apr 18 at 20:02 | history | edited | timmy george | CC BY-SA 4.0 |
added 4 characters in body
|
| Apr 18 at 19:52 | history | edited | timmy george | CC BY-SA 4.0 |
edited body
|
| Apr 18 at 19:47 | history | asked | timmy george | CC BY-SA 4.0 |