Skip to content

Commit

Permalink
Remove some Solaris Studio work-arounds (#4979)
Browse files Browse the repository at this point in the history
Solaris Studio hasn't been updated in almost a decade and the last
version (12.4, circa 2015) doesn't seem to fully support C11.

This PR removes some work-arounds for things like __attribute__()
support.
  • Loading branch information
derobins authored Oct 20, 2024
1 parent ee6c2ee commit 245bb2c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 19 deletions.
2 changes: 0 additions & 2 deletions bin/genparser
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ do
echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wnull-dereference" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#elif defined __SUNPRO_CC ' >> tmp.out
echo '#pragma disable_warn ' >> tmp.out
echo '#elif defined _MSC_VER ' >> tmp.out
echo '#pragma warning(push, 1) ' >> tmp.out
echo '#endif ' >> tmp.out
Expand Down
5 changes: 0 additions & 5 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (${HDF_PREFIX}_HAVE_DARWIN 1)
endif ()

# Check for Solaris
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (${HDF_PREFIX}_HAVE_SOLARIS 1)
endif ()

#-----------------------------------------------------------------------------
# This MACRO checks IF the symbol exists in the library and IF it
# does, it appends library to the list.
Expand Down
2 changes: 0 additions & 2 deletions hl/src/H5LTanalyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
#elif defined __SUNPRO_CC
#pragma disable_warn
#elif defined _MSC_VER
#pragma warning(push, 1)
#endif
Expand Down
2 changes: 0 additions & 2 deletions hl/src/H5LTparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
#elif defined __SUNPRO_CC
#pragma disable_warn
#elif defined _MSC_VER
#pragma warning(push, 1)
#endif
Expand Down
6 changes: 6 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ New Features

Configuration:
-------------
- Dropped some old Solaris Studio work-arounds

Solaris Studio no longer seems to be maintained and the last version
(12.4, circa 2015) doesn't seem to fully support C11. We've removed
some hacks that work around things like __attribute__() support.

- Dropped support for the traditional MSVC preprocessor

Visual Studio has recently started using a standards-compliant
Expand Down
5 changes: 1 addition & 4 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@
* Does the compiler support the __attribute__(()) syntax? It's no
* big deal if we don't.
*
* Note that Solaris Studio supports attribute, but does not support the
* attributes we use.
*
* When using H5_ATTR_FALLTHROUGH, you should also include a comment that
* says FALLTHROUGH to reduce warnings on compilers that don't use
* attributes but do respect fall-through comments.
Expand All @@ -199,7 +196,7 @@
* file). Be sure to update that file if the #ifdefs change here.
*/
/* clang-format off */
#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C)
#if defined(H5_HAVE_ATTRIBUTE)
# define H5_ATTR_FORMAT(X, Y, Z) __attribute__((format(X, Y, Z)))
# define H5_ATTR_UNUSED __attribute__((unused))

Expand Down
3 changes: 1 addition & 2 deletions tools/test/perform/chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
#include <stdlib.h>
#include <string.h>

/* Solaris Studio defines attribute, but for the attributes we need */
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C)
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus
#undef __attribute__
#define __attribute__(X) /*void*/
#define H5_ATTR_UNUSED /*void*/
Expand Down
3 changes: 1 addition & 2 deletions tools/test/perform/overhead.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include <unistd.h>
#endif

/* Solaris Studio defines attribute, but for the attributes we need */
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C)
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus
#undef __attribute__
#define __attribute__(X) /*void*/
#define H5_ATTR_UNUSED /*void*/
Expand Down

0 comments on commit 245bb2c

Please sign in to comment.