Timeline for Belated ascendancy of dynamic linkers
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 29, 2021 at 17:08 | comment | added | supercat |
...a compilation-unit basis provided that external objects or pointers use types int32_t or int64_t , dynamic linking complicates that [variadic functions could be accommodated by having 32-bit signed/unsigned arguments be sign-extended or zero-extended to 64 bits, and having the va_arg function truncate values of 32-bit types to 32 bits, but calls to a standard-library function that expects a long* would need to invoke one of two functions based upon the configured long size].
|
|
Mar 29, 2021 at 17:01 | comment | added | supercat |
@another-dave: I think it would be good to include some kind of concrete example. The question of how printf processes %l is perhaps the most problematical, since there is a fair amount of code which expects long to be the smallest type that's at least 32 bits (which is how it was often treated historically), but there's also code that needed a 64-bit type but opted to use long rather than int64_t or long long . While it should be possible for implementations targeting 64-bit platforms to process code in a way that would allow the size of long long to be specified on...
|
|
Mar 28, 2021 at 21:05 | comment | added | dave | Nit-picking further: the program starts up in the "C" locale and remains there unless it takes specific action to change it. I think your answer would be better without the example. You could make the contrary argument about a shared lib automatically giving the standard behavior for the platform, which a static lib would defeat. Lest it not be clear, I agree that these days predictability general beats saving a few megabytes of (virtual!) memory. I'm just unconvinced by the example. | |
Mar 28, 2021 at 20:04 | comment | added | supercat |
@another-dave: I used %p because it's clearly specified as something which different implementations may process in incompatible ways, none of which is unambiguously "best". Perhaps a more interesting question would have been whether using a sprintf format specifier%3.1f to output the value zero in a French locale will output a string as 0.0 , suitable for feeding to C compilers or many other programs, or as 0,0 so as to be more recognizable to some people (but fewer programs). Do you think the answer would be improved by using the latter example?
|
|
Mar 28, 2021 at 13:49 | comment | added | dave | The %p argument (no pun intended) seems weak, Any program that expects particular format was written without regard to the specification of %p. It'd take, what, 2 more lines of code to handle either? | |
Mar 28, 2021 at 10:35 | comment | added | Incnis Mrsi |
Surely if behavior of %p has critical importance for the software, then static linking of printf is feasible (at the cost of many extra KiBs of memory). But Ī̲ don’t expect statically linked functions to conflict with dynamic linker even if names clash.
|
|
Mar 27, 2021 at 20:57 | history | answered | supercat | CC BY-SA 4.0 |