Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IncrementalCUDADeviceCompiler.cpp - change string comparison to exact match for "-include" #16196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chococandy63
Copy link

Modified the loop to use exact string comparison (s == "-include") instead of checking if the string starts with "-include" (s.find("-include") == 0) to ensure only exact matches are considered.

Explanation

  • (s.find("-include"): Adds s to argv if s starts with "-include".
  • (s == "-include"): Adds s to argv only if s is exactly "-include".

The first snippet is more inclusive, as it will match any string that begins with "-include", such as "-include-pch" or something else starting with "-include", while the second snippet will only match the exact string "-include".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants