Source Code Macro Validation with Compile-Time Records

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing solutions fail to efficiently analyze and debug computer programs with macros during large-scale enterprise-level projects, leading to inefficiencies in porting and maintaining compatibility across different computing platforms, particularly when updating source code.

Innovation Solution

A system and method that records preprocessing information about macros based on compile-time conditions, generating dynamic records to determine if code updates are necessary for a target platform, and facilitating debugging by highlighting relevant code portions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual analysis and debugging of ported code is performed, then code validity can be verified, but development time and effort increase significantly

Engineering Contradiction:
Improvecode validityVSAvoiddevelopment time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary analysis of ported code by automatically detecting macros, resolving their definitions, and determining expandability before manual debugging. This preliminary action identifies potential issues and prepares debugging information in advance, reducing the time required for manual verification while maintaining code validity checks

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system introduces an intermediary debugging layer that sits between code porting and manual analysis. This intermediary automatically resolves macro definitions, tracks their usage, and provides debugging information to developers, mediating between the complex macro processing and human verification to reduce development time while ensuring reliability

Inventive Principle:
Principle #24Intermediary (Mediator)

2Loss of information

If all macro expansions are fully processed, then complete code understanding is achieved, but processing complexity and time increase

Engineering Contradiction:
Improvecode understandingVSAvoidprocessing complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The system applies partial action by selectively processing macro expansions based on debugging needs rather than fully expanding all macros. It detects macros and determines their expandability without necessarily performing complete expansion, providing sufficient code understanding while avoiding excessive processing complexity and time

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system segments the macro processing task into distinct phases: macro detection, definition resolution, expandability determination, and selective expansion. This segmentation allows the system to process only relevant portions of the code with full macro understanding where needed, while avoiding unnecessary processing elsewhere, reducing overall complexity

Inventive Principle:
Principle #1Segmentation

3Productivity

If platform-specific code filtering is implemented, then porting efficiency improves, but analysis completeness may be reduced

Engineering Contradiction:
Improveporting efficiencyVSAvoidanalysis completeness
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The system applies local quality by providing different levels of analysis completeness for different code regions. Platform-specific code sections receive focused filtering with complete analysis, while non-critical sections receive streamlined processing. This ensures porting efficiency through selective filtering while maintaining analysis completeness where it matters most for platform compatibility

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP4416588B1Checking source code validity at time of code update
Publication Date: 2025.09.03 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • EP4416588B1 patent drawingFigure 1
  • EP4416588B1 patent drawingFigure 2A
  • EP4416588B1 patent drawingFigure 2B

AI summary

A computer-implemented method includes receiving, by a processor, an updated version of a computer program that includes several source code changes. A compiler preprocesses the source code changes for a target computing platform. The preprocessing includes identifying a compile time condition associated with one or more computer instructions enclosed by a macro, determining a current value of the compile time condition at the time of compiling, and determining corresponding object code based on the current value. Further, a macro information record for the macro is generated that includes the compile time condition, the current value, and an identification of the computer instructions. Further, a linker preprocesses the source code changes. This preprocessing includes determining that the object code is not included in an executable file, and updating the macro information record to indicate that the macro is not included in the executable file.