root icon indicating copy to clipboard operation
root copied to clipboard

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

Open b1shtream opened this issue 1 year ago • 0 comments

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".

b1shtream avatar Aug 08 '24 13:08 b1shtream