public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] declare getpass in analyzer/sensitive-1.c test
@ 2020-12-25  1:47 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2020-12-25  1:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f1788166d70de8b46d908435e01c81713d1ca0ed

commit f1788166d70de8b46d908435e01c81713d1ca0ed
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 24 22:43:32 2020 -0300

    declare getpass in analyzer/sensitive-1.c test
    
    The getpass function is not available on all systems; and not
    necessarily declared in unistd.h, as expected by the sensitive-1
    analyzer test.
    
    Since this is a compile-only test, it doesn't really matter if the
    function is defined in the system libraries.  All we need is a
    declaration, to avoid warnings from calling an undeclared function.
    This patch adds the declaration, in a way that is most unlikely to
    conflict with any existing declaration.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.dg/analyzer/sensitive-1.c: Declare getpass.

Diff:
---
 gcc/testsuite/gcc.dg/analyzer/sensitive-1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index 81144af620e..c66af927617 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -6,6 +6,11 @@
 
 #include <string.h>
 
+/* Declare getpass, in case unistd doesn't declare it.
+   Parenthesize it, in case it's a macro.
+   Don't use a prototype, to avoid const mismatches.  */
+extern char *(getpass) ();
+
 char test_1 (FILE *logfile)
 {
   char *password = getpass (">"); /* { dg-message "\\(1\\) sensitive value acquired here" } */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] declare getpass in analyzer/sensitive-1.c test
@ 2021-01-01  5:22 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2021-01-01  5:22 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d90eeed1fb6e03564fe1a256e4d758d454bbded3

commit d90eeed1fb6e03564fe1a256e4d758d454bbded3
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 31 21:38:17 2020 -0300

    declare getpass in analyzer/sensitive-1.c test
    
    The getpass function is not available on all systems; and not
    necessarily declared in unistd.h, as expected by the sensitive-1
    analyzer test.
    
    Since this is a compile-only test, it doesn't really matter if the
    function is defined in the system libraries.  All we need is a
    declaration, to avoid warnings from calling an undeclared function.
    This patch adds the declaration, in a way that is most unlikely to
    conflict with any existing declaration.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.dg/analyzer/sensitive-1.c: Declare getpass.

Diff:
---
 gcc/testsuite/gcc.dg/analyzer/sensitive-1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index 81144af620e..c66af927617 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -6,6 +6,11 @@
 
 #include <string.h>
 
+/* Declare getpass, in case unistd doesn't declare it.
+   Parenthesize it, in case it's a macro.
+   Don't use a prototype, to avoid const mismatches.  */
+extern char *(getpass) ();
+
 char test_1 (FILE *logfile)
 {
   char *password = getpass (">"); /* { dg-message "\\(1\\) sensitive value acquired here" } */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] declare getpass in analyzer/sensitive-1.c test
@ 2021-01-01  1:30 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2021-01-01  1:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a157d8c865f63d7b67b9dcc9a7ca72f06cc6ade1

commit a157d8c865f63d7b67b9dcc9a7ca72f06cc6ade1
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 31 21:38:17 2020 -0300

    declare getpass in analyzer/sensitive-1.c test
    
    The getpass function is not available on all systems; and not
    necessarily declared in unistd.h, as expected by the sensitive-1
    analyzer test.
    
    Since this is a compile-only test, it doesn't really matter if the
    function is defined in the system libraries.  All we need is a
    declaration, to avoid warnings from calling an undeclared function.
    This patch adds the declaration, in a way that is most unlikely to
    conflict with any existing declaration.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.dg/analyzer/sensitive-1.c: Declare getpass.

Diff:
---
 gcc/testsuite/gcc.dg/analyzer/sensitive-1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index 81144af620e..c66af927617 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -6,6 +6,11 @@
 
 #include <string.h>
 
+/* Declare getpass, in case unistd doesn't declare it.
+   Parenthesize it, in case it's a macro.
+   Don't use a prototype, to avoid const mismatches.  */
+extern char *(getpass) ();
+
 char test_1 (FILE *logfile)
 {
   char *password = getpass (">"); /* { dg-message "\\(1\\) sensitive value acquired here" } */


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-01  5:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25  1:47 [gcc(refs/users/aoliva/heads/testme)] declare getpass in analyzer/sensitive-1.c test Alexandre Oliva
2021-01-01  1:30 Alexandre Oliva
2021-01-01  5:22 Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).