Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

50%
+0 −0
Challenges Keyword golfing

C (gcc), 358 bytes static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Sta...

posted 2y ago by Lundin‭  ·  edited 1y ago by Lundin‭

Answer
#2: Post edited by user avatar Lundin‭ · 2023-08-09T11:34:51Z (over 1 year ago)
  • # [C (gcc)], 358 bytes
  • <!-- language-all: lang-c -->
  • static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Static_assert(_Alignof(_Bool),"_Imaginary");do goto a;while(sizeof B);if(1)for(auto volatile const signed short int i;;)continue;else switch(_Generic(0,default:0))case 0:a:break;return;}
  • [Try it online!][TIO-l4fczi53]
  • [C (gcc)]: https://gcc.gnu.org/
  • [TIO-l4fczi53]: https://tio.run/##LVDLTgMxDPwVq6cEgVSuzanlgLhwKffIzTq7Edm4Spw@qPrrLBZwsGR5RjPjCU9jCMvSBCUFSCWnQuDfuZL0WiBmRoFoeklcoFtHFyG9@4@pEg4@c8AM/oXnY6YLZC4jDNwPmR4qNakpCOzcjKmYE6fB3vxWeFanSmNqKgVU@gy37d3J9UgDRfDbnMaCTT2bLjRAmLBaFesqtnd@/5vVY2tUxfzRORq/Y872ceXfZhxTwXpdWTcwjCwM6M5TymRa@iKOsLMuRfNsI1eDXfETZxXNBIFLE/g3bhNX0VJ0nLMKSSqdHOVG0M5JwmT8KxXSN836UcNjz7JZWxtQGesNbg7a0qf7K9Pdl@U7xIxjW57OPw "C (gcc) – Try It Online"
  • Since nobody dared to take on C since this was posted, here's my attempt. It fulfils the "doesn't crash" criteria (though returns an unspecified value from the program).
  • Disclaimer: I couldn't get `_Imaginary` to work in gcc and clang doesn't even support complex numbers. Therefore I included the keyword inside a string literal, so that I won't get any unfair advantage against someone who can manage to get it working on some compiler.
  • # [C (gcc)], 358 bytes
  • <!-- language-all: lang-c -->
  • static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Static_assert(_Alignof(_Bool),"_Imaginary");do goto a;while(sizeof B);if(1)for(auto volatile const signed short int i;;)continue;else switch(_Generic(0,default:0))case 0:a:break;return;}
  • [Try it online!][TIO-l4fczi53]
  • [C (gcc)]: https://gcc.gnu.org/
  • [TIO-l4fczi53]: https://tio.run/##LVDLTgMxDPwVq6cEgVSuzanlgLhwKffIzTq7Edm4Spw@qPrrLBZwsGR5RjPjCU9jCMvSBCUFSCWnQuDfuZL0WiBmRoFoeklcoFtHFyG9@4@pEg4@c8AM/oXnY6YLZC4jDNwPmR4qNakpCOzcjKmYE6fB3vxWeFanSmNqKgVU@gy37d3J9UgDRfDbnMaCTT2bLjRAmLBaFesqtnd@/5vVY2tUxfzRORq/Y872ceXfZhxTwXpdWTcwjCwM6M5TymRa@iKOsLMuRfNsI1eDXfETZxXNBIFLE/g3bhNX0VJ0nLMKSSqdHOVG0M5JwmT8KxXSN836UcNjz7JZWxtQGesNbg7a0qf7K9Pdl@U7xIxjW57OPw "C (gcc) – Try It Online"
  • Since nobody dared to take on C since this was posted, here's my attempt. It fulfills the "doesn't crash" criteria (though returns an unspecified value from the program).
  • Disclaimer: I couldn't get `_Imaginary` to work in gcc and clang doesn't even support complex numbers. Therefore I included the keyword inside a string literal, so that I won't get any unfair advantage against someone who can manage to get it working on some compiler.
#1: Initial revision by user avatar Lundin‭ · 2022-06-15T08:57:15Z (over 2 years ago)
# [C (gcc)], 358 bytes

<!-- language-all: lang-c -->

    static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Static_assert(_Alignof(_Bool),"_Imaginary");do goto a;while(sizeof B);if(1)for(auto volatile const signed short int i;;)continue;else switch(_Generic(0,default:0))case 0:a:break;return;}

[Try it online!][TIO-l4fczi53]

[C (gcc)]: https://gcc.gnu.org/
[TIO-l4fczi53]: https://tio.run/##LVDLTgMxDPwVq6cEgVSuzanlgLhwKffIzTq7Edm4Spw@qPrrLBZwsGR5RjPjCU9jCMvSBCUFSCWnQuDfuZL0WiBmRoFoeklcoFtHFyG9@4@pEg4@c8AM/oXnY6YLZC4jDNwPmR4qNakpCOzcjKmYE6fB3vxWeFanSmNqKgVU@gy37d3J9UgDRfDbnMaCTT2bLjRAmLBaFesqtnd@/5vVY2tUxfzRORq/Y872ceXfZhxTwXpdWTcwjCwM6M5TymRa@iKOsLMuRfNsI1eDXfETZxXNBIFLE/g3bhNX0VJ0nLMKSSqdHOVG0M5JwmT8KxXSN836UcNjz7JZWxtQGesNbg7a0qf7K9Pdl@U7xIxjW57OPw "C (gcc) – Try It Online"

Since nobody dared to take on C since this was posted, here's my attempt. It fulfils the "doesn't crash" criteria (though returns an unspecified value from the program).

Disclaimer: I couldn't get `_Imaginary` to work in gcc and clang doesn't even support complex numbers. Therefore I included the keyword inside a string literal, so that I won't get any unfair advantage against someone who can manage to get it working on some compiler.