12

Implementation-defined behaviors in C are unspecified behaviors for which each conforming implementation must document its choice.

I found such documentations easily for gcc here or Microsoft C here, but I can't find any such documentation for clang.

Am I searching wrong or is there no such thing?

Sean Bright
  • 114,945
  • 17
  • 134
  • 143
pwilke
  • 131
  • 4
  • GCC does not document all implementation-defined behavior. E.g. it doesn't document the implementation-defined behavior in https://eel.is/c++draft/basic.stc#general-4: are uses of dangling pointers (other than dereferencing them) UB? – Blaisorblade Dec 10 '20 at 03:50

1 Answers1

7

This ticket https://bugs.llvm.org/show_bug.cgi?id=11272 is still opened (for many years now) so it seems that clang doesn't explicitly specify implementation defined behaviour.

For most cases I would bet that it's the same as GCC, though.

David Grayson
  • 79,096
  • 23
  • 144
  • 182
dreamzor
  • 5,715
  • 4
  • 39
  • 59
  • 3
    So clang is not a conforming C compiler and it it even worse than Visual Studio? Oh that burns. Not even Borland Turbo C from 1990 is worse than Visual Studio... Normative term: 3.4.1 **implementation-defined behavior** unspecified behavior where each implementation documents how the choice is made. – Lundin Mar 31 '16 at 14:12
  • 1
    @Lundin: Yes, the lack of documentation makes it non-conforming. I wouldn't agree that that makes it "even worse than Visual Studio". (Though I haven't used VS enough to comment on its quality.) – Keith Thompson Mar 31 '16 at 16:30