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
@@ -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
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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
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
@@ -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
@@ -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
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
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
@@ -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
@@ -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
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
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
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
26 matches
Mail list logo