Skip to content

Conversation

@plexoos
Copy link

@plexoos plexoos commented Dec 9, 2025

See qudarap/QEvt.hh

struct QUDARAP_API QEvt : public SCompProvider
{
...
#ifndef PRODUCTION
...
    NP*      gatherGenstepFromDevice() const ;
...
#endif
...
};

See qudarap/QEvt.hh

 ```cpp
 struct QUDARAP_API QEvt : public SCompProvider
 {
 ...
 #ifndef PRODUCTION
 ...
     NP*      gatherGenstepFromDevice() const ;
 ...
 #endif
 ...
 };
 ```
Copilot AI review requested due to automatic review settings December 9, 2025 17:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents calls to undefined functions in production builds by guarding the call to gatherGenstepFromDevice() with the #ifndef PRODUCTION macro. The method gatherGenstepFromDevice() is a debug-only function that downloads genstep data from device memory, and its declaration in the header file is already conditionally compiled out in production builds.

Key Changes:

  • Added #ifndef PRODUCTION / #endif guards around the SCOMP_GENSTEP case in the switch statement to prevent calling an undefined function in production builds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1362 to 1364
//case SCOMP_GENSTEP: a = getGenstep() ; break ;
#ifndef PRODUCTION
case SCOMP_GENSTEP: a = gatherGenstepFromDevice() ; break ;
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When PRODUCTION is defined, the SCOMP_GENSTEP case will return nullptr instead of providing the host-side genstep data. Consider uncommenting line 1362 to use getGenstep() as a fallback, or add an #else clause:

#ifndef PRODUCTION
        case SCOMP_GENSTEP:       a = gatherGenstepFromDevice() ; break ;
#else
        case SCOMP_GENSTEP:       a = getGenstep() ; break ;
#endif

This would ensure that genstep data remains accessible in production builds via the host-side copy, while avoiding the debug-only device download.

Suggested change
//case SCOMP_GENSTEP: a = getGenstep() ; break ;
#ifndef PRODUCTION
case SCOMP_GENSTEP: a = gatherGenstepFromDevice() ; break ;
#ifndef PRODUCTION
case SCOMP_GENSTEP: a = gatherGenstepFromDevice() ; break ;
#else
case SCOMP_GENSTEP: a = getGenstep() ; break ;

Copilot uses AI. Check for mistakes.
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.

1 participant