[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Thank you, the changes LGTM assuming precommit CI doesn't discover anything. @cor3ntin are you happy with the changes as well? https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread Yi-Chi Lee via cfe-commits
@@ -1721,11 +1723,15 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread Yi-Chi Lee via cfe-commits
https://github.com/yichi170 updated https://github.com/llvm/llvm-project/pull/99075 >From 0fcbd4a46bb05ad9829fcf33a9829fd5f5269c71 Mon Sep 17 00:00:00 2001 From: yichi170 Date: Wed, 17 Jul 2024 02:15:43 +0800 Subject: [PATCH 1/4] [clang] replaced the usage of `asctime` with `strftime` --- cla

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread via cfe-commits
@@ -1721,11 +1723,15 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread Fangrui Song via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-21 Thread Yi-Chi Lee via cfe-commits
https://github.com/yichi170 edited https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-21 Thread Yi-Chi Lee via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -1722,10 +1722,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by asctime. const char *Result; +char TimeStrin

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Yi-Chi Lee via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned b

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Yi-Chi Lee via cfe-commits
yichi170 wrote: I submitted a commit that used the original way with error handling and fixed-sized TimeString. > (an alternative would be to use the C++ interface > https://compiler-explorer.com/z/WEqTW341b ) Since I'm not familiar with the issue related to locale, I'm not sure which method

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Yi-Chi Lee via cfe-commits
https://github.com/yichi170 updated https://github.com/llvm/llvm-project/pull/99075 >From 0fcbd4a46bb05ad9829fcf33a9829fd5f5269c71 Mon Sep 17 00:00:00 2001 From: yichi170 Date: Wed, 17 Jul 2024 02:15:43 +0800 Subject: [PATCH 1/2] [clang] replaced the usage of `asctime` with `strftime` --- cla

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread via cfe-commits
@@ -1722,10 +1722,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by asctime. const char *Result; +char TimeStrin

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -1722,10 +1722,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by asctime. const char *Result; +char TimeStrin

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-17 Thread via cfe-commits
cor3ntin wrote: `asctime` is deprecated. But `asctime_s` is not. See https://en.cppreference.com/w/c/chrono/asctime using `strftime` is going to be challenging because of locale (ie we would have to temporarily switch to a C locale - both because we want a locale independent behavior, and beca

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread Yi-Chi Lee via cfe-commits
https://github.com/yichi170 edited https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread Yi-Chi Lee via cfe-commits
@@ -1722,10 +1722,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by asctime. const char *Result; +char TimeStrin

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread Shafik Yaghmour via cfe-commits
@@ -1722,10 +1722,12 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by asctime. const char *Result; +char TimeStrin

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yi-Chi Lee (yichi170) Changes In `clang/lib/Lex/PPMacroExpansion.cpp`, replaced the usage of the obsolete `asctime` function with `strftime` for generating timestamp strings. This is my first time contributing to an open-source project. I

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-16 Thread Yi-Chi Lee via cfe-commits
https://github.com/yichi170 created https://github.com/llvm/llvm-project/pull/99075 In `clang/lib/Lex/PPMacroExpansion.cpp`, replaced the usage of the obsolete `asctime` function with `strftime` for generating timestamp strings. This is my first time contributing to an open-source project. If