Bug 55324 - Too many preprocessors (cpp)
Summary: Too many preprocessors (cpp)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillScript, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2012-09-25 15:50 UTC by Michael Stahl
Modified: 2025-12-12 09:47 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl 2012-09-25 15:50:29 UTC
during the build too many weird C preprocessors (cpp) are built;
it would be good to consolidate that down to one.

the UNO IDL compiler is shipped with the SDK and currently
uses "ucpp" preprocessor, so we cannot get rid of that one.

others such as the "cpp.lcc" built in soltools could probably be
replaced with ucpp, or usage of the system cpp (latter requires
further investigation).
Comment 1 Don't use this account, use tml@iki.fi 2012-09-25 15:53:48 UTC
s/system cpp/compiler's -E functionality
Comment 2 David Tardon 2012-10-03 04:53:55 UTC
(In reply to comment #0)
> during the build too many weird C preprocessors (cpp) are built;
> it would be good to consolidate that down to one.

YES!

> others such as the "cpp.lcc" built in soltools could probably be
> replaced with ucpp, or usage of the system cpp (latter requires
> further investigation).

I have tried that once. The problem is that the various CONCATn macros used in scp2 often produce strings that are not valid preprocessor tokens (e.g., library names with dot in them), thus causing errors. It would be interesting to try it with ucpp. Anyway, the problem should not be hard to fix by introducing a new family of macros, let's say CONCATSTRn, that shall stringify the args and put them side by side (e.g., CONCATSTR3(foo,..,so) -> "foo" "." "so"), and teaching pre2par.pl to handle that.
Comment 3 Björn Michaelsen 2013-10-04 18:48:14 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 4 Robinson Tryon (qubit) 2015-12-14 06:54:52 UTC Comment hidden (obsolete)
Comment 5 Robinson Tryon (qubit) 2016-02-18 14:52:40 UTC Comment hidden (obsolete)
Comment 6 jani 2016-05-17 06:01:18 UTC
*** Bug 99879 has been marked as a duplicate of this bug. ***
Comment 7 jani 2016-05-17 08:03:33 UTC Comment hidden (obsolete)
Comment 8 jani 2016-05-17 08:36:05 UTC
*** Bug 99879 has been marked as a duplicate of this bug. ***
Comment 9 Stephan Bergmann 2025-12-10 13:58:57 UTC
(In reply to Michael Stahl from comment #0)
> the UNO IDL compiler is shipped with the SDK and currently
> uses "ucpp" preprocessor, so we cannot get rid of that one.

(ucpp has meanwhile been removed in <https://git.libreoffice.org/core/+/a8485d558fab53291e2530fd9a1be581c1628deb%5E%21> "[API CHANGE] Remove deprecated idlc and regmerge from the SDK"; not sure what other C preprocessor instances, if any, would be left)
Comment 10 Hossein 2025-12-12 09:44:55 UTC
I could not find references to cpp.lcc in addition to the removed idlc and ucpp. I could only find these tools in soltools:

1. cpp: custom c preprocessor
   https://en.wikipedia.org/wiki/C_preprocessor

2. mkdepend (makedepend): X utility program to generate c dependencies of C files
   https://en.wikipedia.org/wiki/Makedepend
   https://gitlab.freedesktop.org/xorg/util/makedepend

mkdepend and cpp are in use in solenv/ in solenv/gbuild/extensions/pre_BuildTools.mk and elsewhere. Therefore, they may not be removed at the moment.

It may be possible to use compiler's ability to process C files instead of makedpeend or use newer implementations, but that is another story.

gcc-based clone of makedepend
https://github.com/afborchert/gcc-makedepend/

Therefore, I close this issue as resolved/fixed to reflect the removal of ucpp. The task was to
Comment 11 Hossein 2025-12-12 09:47:02 UTC
To complete the above sentence:

The task was to reduce too many preprocessors, and not removal of all custom preprocessors. For removing all the custom preprocessors (not sure if it is possible), one can create a separate issue.