On Tue, Mar 21, 2023 at 7:18 PM Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > > On 3/21/23 12:12, Alexander Monakov wrote: > >>> Yes, it’s better to know the details of languages standard. -:) > >>> However, I don’t think that this is a realistic expectation to the > >>> compiler > >>> users: to know all the details of a language standard. > >> Umm, they really do need to know that stuff. > >> > >> If the developer fails to understand the language standard, then they're > >> likely going to write code that is ultimately undefined or doesn't behave > >> in > >> they expect. How is the compiler supposed to guess what the developer > >> originally intended? How should the compiler handle the case when two > >> developers have different understandings of how a particular piece of code > >> should work? In the end it's the language standard that defines how all > >> this > >> stuff should work. > >> > >> Failure to understand the language is a common problem and we do try to > >> emit > >> various diagnostics to help developers avoid writing non-conformant code. > >> But > >> ultimately if a developer fails to understand the language standard, then > >> they're going to be surprised by the behavior of their code. > > > > W h a t. > > > > This subthread concerns documenting the option better ("Without clearly > > documenting such warnings ..."). > > > > Are you arguing against adding a brief notice to the documentation blurb for > > the -ffp-contract= option? > I was merely chiming in on Qing's statement that it is not realistic to > expect users to know the details of the language standard.
I think it's even less realistic to expect users to know the details of floating-point math. So I doubt any such sentence will be helpful besides spreading some FUD? > > > Jeff