From: Sangamesh Mallayya Date: Thu, 29 Jan 2026 13:04:40 +0000 (-0600) Subject: Fix AIX build break in gcc/diagnostics/sarif-sink.cc. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc10a49c37501e0603236fd9ca1f3a63bec24cc7;p=thirdparty%2Fgcc.git Fix AIX build break in gcc/diagnostics/sarif-sink.cc. In AIX, build fails while trying to compile gcc/diagnostics/sarif-sink.cc. Here is the snapshot of the error we are getting. In file included from /opt/freeware/src/packages/BUILD/gcc/gcc/system.h:46, from /opt/freeware/src/packages/BUILD/gcc/gcc/diagnostics/sarif-sink.cc:34: /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/13/include-fixed/stdio.h:593:12: error: conflicting declaration of C function 'int fgetpos64(FILE*, fpos64_t*)' 593 | extern int fgetpos64(FILE *, fpos64_t *); | ^~~~~~~~~ This happens when we include sys/types.h before defining _LARGE_FILES. We can see similar errors with this sample program. #include #define _LARGE_FILES 1 #include int main() { return 0; } In gcc/diagnostics/sarif-sink.cc we are including config.h after #include which intern including sys/types.h and causing the conflicting errors. Including config.h before including sys/un.h should solve this error. The patch is to fix the build break on AIX. gcc/ChangeLog: * diagnostics/sarif-sink.cc: Move config.h at the begining. --- diff --git a/gcc/diagnostics/sarif-sink.cc b/gcc/diagnostics/sarif-sink.cc index 78743df7f1d..94db35ca864 100644 --- a/gcc/diagnostics/sarif-sink.cc +++ b/gcc/diagnostics/sarif-sink.cc @@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +#include "config.h" + #ifdef __MINGW32__ #include #include @@ -26,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include #endif -#include "config.h" #define INCLUDE_LIST #define INCLUDE_MAP #define INCLUDE_STRING