Skip to content

Centralize _LARGEFILE64_SOURCE definition in CMakeLists.txt#58

Merged
folkertvanheusden merged 1 commit into
folkertvanheusden:masterfrom
mikelolasagasti:LARGEFILE64-redefinition
Jan 2, 2026
Merged

Centralize _LARGEFILE64_SOURCE definition in CMakeLists.txt#58
folkertvanheusden merged 1 commit into
folkertvanheusden:masterfrom
mikelolasagasti:LARGEFILE64-redefinition

Conversation

@mikelolasagasti

Copy link
Copy Markdown
Contributor

Move the _LARGEFILE64_SOURCE macro definition from individual source files to CMakeLists.txt. This eliminates redefinition warnings when system headers (features.h) also define this macro:

In file included from
/builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.c:50: /builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.h:4:9: warning: ‘_LARGEFILE64_SOURCE’ redefined
    4 | #define _LARGEFILE64_SOURCE     /* required for GLIBC to enable
stat64 and friends */
      |         ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ctype.h:25,
                 from
/builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.c:3:
/usr/include/features.h:238:10: note: this is the location of the
previous definition
  238 | # define _LARGEFILE64_SOURCE    1
      |          ^~~~~~~~~~~~~~~~~~~

Move the _LARGEFILE64_SOURCE macro definition from individual source
files to CMakeLists.txt. This eliminates redefinition warnings when
system headers (features.h) also define this macro:

In file included from
/builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.c:50:
/builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.h:4:9:
warning: ‘_LARGEFILE64_SOURCE’ redefined
    4 | #define _LARGEFILE64_SOURCE     /* required for GLIBC to enable
stat64 and friends */
      |         ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ctype.h:25,
                 from
/builddir/build/BUILD/multitail-7.1.5-build/multitail-7.1.5/mt.c:3:
/usr/include/features.h:238:10: note: this is the location of the
previous definition
  238 | # define _LARGEFILE64_SOURCE    1
      |          ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
@folkertvanheusden folkertvanheusden merged commit fbac45a into folkertvanheusden:master Jan 2, 2026
2 checks passed
@mikelolasagasti mikelolasagasti deleted the LARGEFILE64-redefinition branch January 2, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants