ANSI C: standard definition for the size of the __DATE__ and __TIME__ strings?

后端 未结 2 1357
情深已故
情深已故 2021-01-25 04:29

Is there a standard definition for the size of the __DATE__ and __TIME__ strings in ANSI C?

The motivation behind this question is:

  • I have two applicati

2条回答
  •  梦毁少年i
    2021-01-25 04:39

    ISO/IEC 9899:2011, §6.10.8.1 Mandatory macros

    __DATE__ The date of translation of the preprocessing translation unit: a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not available, an implementation-defined valid date shall be supplied.

    __TIME__ The time of translation of the preprocessing translation unit: a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function. If the time of translation is not available, an implementation-defined valid time shall be supplied.

    It is very straight-forward, therefore.

提交回复
热议问题