[rtems commit] psxhdrs: Fix warnings

Joel Sherrill joel at rtems.org
Wed Dec 5 18:01:04 UTC 2018


Module:    rtems
Branch:    master
Commit:    e517fe682a55aa9dbd98057b621ab46012861d85
Changeset: http://git.rtems.org/rtems/commit/?id=e517fe682a55aa9dbd98057b621ab46012861d85

Author:    Joel Sherrill <joel at rtems.org>
Date:      Wed Dec  5 11:58:59 2018 -0600

psxhdrs: Fix warnings

---

 testsuites/psxtests/psxhdrs/dlfcn/dlerror.c        |  7 ++---
 testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c | 32 ++++++++++++----------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c
index 4ba13da..7393761 100644
--- a/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c
@@ -26,14 +26,11 @@
 
  int test( void );
 
- int result = 1;
-
  int test( void )
  {
-   char *errstr;
+   const char *errstr;
 
    errstr = dlerror();
-   result = 0;
 
-   return result;
+   return (errstr != NULL);
  }
diff --git a/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c b/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c
index cdcdff7..b1a4c8d 100644
--- a/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c
+++ b/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c
@@ -2,6 +2,7 @@
  *  @file
  *  @brief strcasecmp_l() API Conformance Test
  */
+
 /*
  *  COPYRIGHT (c) 2018.
  *  Himanshu Sekhar Nayak
@@ -18,22 +19,25 @@
  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _POSIX_C_SOURCE 200809L
 
- #include <strings.h>
- #include <locale.h>
+#include <strings.h>
+#include <locale.h>
 
- int test( void );
+int test( void );
 
- int test( void )
- {
-   char *string1 = "STRING";
-   char *string2 = "string";
-   int result;
+int test( void )
+{
+  char *string1 = "STRING";
+  char *string2 = "string";
+  locale_t locale = NULL;
+  int result;
 
-   result = strcasecmp_l( string1, string2, LC_CTYPE );
+  result = strcasecmp_l( string1, string2, locale );
 
-   return result;
- }
+  return result;
+}



More information about the vc mailing list