Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
246a2730
Commit
246a2730
authored
Mar 04, 2011
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR 47802 Use builtins to check localtime_r return type
From-SVN: r170683
parent
87e7b310
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
libgfortran/ChangeLog
+6
-0
libgfortran/intrinsics/ctime.c
+8
-3
No files found.
libgfortran/ChangeLog
View file @
246a2730
2011-03-04 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/47802
* intrinsics/ctime.c (strctime): Use builtins to check localtime_r
return type.
2011-03-04 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/47802
* intrinsics/ctime.c (strctime): Don't use return value of
localtime_r.
...
...
libgfortran/intrinsics/ctime.c
View file @
246a2730
...
...
@@ -40,11 +40,16 @@ strctime (char *s, size_t max, const time_t *timep)
{
#ifdef HAVE_STRFTIME
struct
tm
ltm
;
/* Note: We can't use the return value of localtime_r, as some
targets provide
localtime_r based on a draft of the POSIX
int
failed
;
/* Some targets provide a
localtime_r based on a draft of the POSIX
standard where the return type is int rather than the
standardized struct tm*. */
localtime_r
(
timep
,
&
ltm
);
__builtin_choose_expr
(
__builtin_classify_type
(
localtime_r
(
timep
,
&
ltm
))
==
5
,
failed
=
localtime_r
(
timep
,
&
ltm
)
==
NULL
,
failed
=
localtime_r
(
timep
,
&
ltm
)
!=
0
);
if
(
failed
)
return
0
;
return
strftime
(
s
,
max
,
"%c"
,
&
ltm
);
#else
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment