Skip to content

Commit aff0462

Browse files
committed
Fix the detection of Clang versions
Use __clang_major__ instead of LLVM_VERSION_MAJOR.
1 parent ecc9940 commit aff0462

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

frontends/ovdb_stat.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/*
22
* ovdb_stat.c
33
* print information about ovdb database
4+
*
5+
* Created by Heath Kehoe in 2000.
6+
* Various bug fixes, code and documentation improvements since then
7+
* in 2000-2004, 2006, 2008, 2013-2015, 2018, 2021-2025.
48
*/
59

610
#include "portable/system.h"
@@ -248,7 +252,7 @@ end_table(void)
248252
* like GCC or Clang, but is undefined behaviour by the C Standard as it is
249253
* unknown whether all hardware platforms can actually process such pointer
250254
* arithmetic (many, if not all, can anyway). */
251-
# if LLVM_VERSION_MAJOR > 12
255+
# if defined(__clang__) && __clang_major__ > 12
252256
# pragma GCC diagnostic ignored "-Wnull-pointer-subtraction"
253257
# endif
254258
# define OFFSETOF(type, f) ((char *) &(((type *) 0)->f) - (char *) 0)

include/innperl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/*
22
** Declarations for embedded Perl.
3+
**
4+
** Put into a separate header file in 2002.
5+
** Various bug fixes, code and documentation improvements since then
6+
** in 2002, 2003, 2015, 2021, 2024, 2025.
37
*/
48

59
#ifndef INNPERL_H
@@ -12,7 +16,7 @@
1216

1317
/* Suppress warnings triggered by Perl macros like PUSHMARK or POPp. */
1418
# if defined(__llvm__) || defined(__clang__)
15-
# if LLVM_VERSION_MAJOR > 11
19+
# if __clang_major__ > 11
1620
# pragma GCC diagnostic ignored "-Wcompound-token-split-by-macro"
1721
# endif
1822
# pragma GCC diagnostic ignored "-Wgnu-statement-expression"

innfeed/imap_connection.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/*
22
** Feed articles to an IMAP server via LMTP and IMAP.
33
**
4-
** Written by Tim Martin.
4+
** Written by Tim Martin in 2000.
5+
**
6+
** Various bug fixes, code and documentation improvements since then
7+
** in 2000-2004, 2006-2011, 2013-2016, 2018, 2021, 2022, 2024, 2025.
58
**
69
** Instead of feeding articles via nntp to another host this feeds the
710
** messages via lmtp to a host and the control messages (cancel's etc..) it
@@ -1329,7 +1332,7 @@ getsecret(sasl_conn_t *conn, void *context UNUSED, int id,
13291332
return SASL_OK;
13301333
}
13311334

1332-
# if __GNUC__ > 7 || LLVM_VERSION_MAJOR > 12
1335+
# if __GNUC__ > 7 || (defined(__clang__) && __clang_major__ > 12)
13331336
# pragma GCC diagnostic ignored "-Wcast-function-type"
13341337
# endif
13351338

@@ -1342,7 +1345,7 @@ static sasl_callback_t saslcallbacks[] = {
13421345
{SASL_CB_LIST_END, NULL, NULL}
13431346
};
13441347

1345-
# if __GNUC__ > 7 || LLVM_VERSION_MAJOR > 12
1348+
# if __GNUC__ > 7 || (defined(__clang__) && __clang_major__ > 12)
13461349
# pragma GCC diagnostic warning "-Wcast-function-type"
13471350
# endif
13481351

0 commit comments

Comments
 (0)