6
\$\begingroup\$

When writing an answer, people here usually start with stating in which language it's implemented. When C is concerned, there is the "implicit int" rule that was, as far as I know, removed in 2011. This rule is very important for golfing. For example, a function calculating a square of a number:

s(a){return a*a;}           // with implicit int
int s(int a){return a*a;}   // without implicit int

If I specify that my code is in C, and my code is newer than 2011, does it imply that I cannot use the implicit-int rule?

Or, if I want to use the implicit-int rule, should I have to specify my language as "C99" or "C89" or "gcc version 4.6.4"?

Here, implicit-int is just an example. In general, what does "C" mean as a name of a programming language - "most recent C version at the time of code's creation" or "some unspecified version" or "C89"?

||||||
\$\endgroup\$
  • 3
    \$\begingroup\$ I started specifying Java 7 on mine, even with full backward compatibility, just so people would stop bugging me to lambdify everything. I'd recommend it even moreso if it depends on being a certain version (or group of versions). \$\endgroup\$ – Geobits Oct 27 '16 at 14:05
  • \$\begingroup\$ @Geobits You know, you could add a lambda to allow reuse: "I started specifying ((\x -> Java x) 7) on mine, ..." \$\endgroup\$ – jpaugh Oct 31 '16 at 14:18
9
\$\begingroup\$

Yes, just stating C in your header is ambiguous. As long as your submission doesn't rely on undefined, unspecified, or implementation-defined behavior, doesn't use any GNU extensions, and doesn't depend on the machine's endianness, operating system, etc., just stating the standard (C89, C99, C11) should be plenty.

In all other cases (and there are a lot of them), that might be ambiguous as well. To counter that, you basically have two options.

  • Be specific about the conditions you tested your code in. Depending on your submission, that might require a lot of information.

  • Include a link to an online interpreter. You can't argue with results.

||||||
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .