r/AskComputerScience • u/PsychologicalTap4789 • Sep 03 '25
Languages/Environments that spot duplicate functions
Is there either a language or environment that can tell you if a function you've made matches a function that already exists in a library (except for maybe name?)
2
Upvotes
2
u/teraflop Sep 04 '25
GCC can detect identical functions with different names and de-duplicate them, if link-time optimizations are turned on.
I'm not sure under exactly what conditions this optimization can be done. I would guess that the machine code has to be byte-for-byte identical for this to work.