TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24294 15
I am getting compilation error for my old cpp source code in new build envrionment

#define blahblah(SWC_MAJOR_VER, SWC_MINOR_VER) \

{ \

Dt_RECORD_SWC_Identification vSWCinfo = \

{ .DeSWCVersion = { .DeMajor = (SWC_MAJOR_VER), .DeMinor = (SWC_MINOR_VER) }, \

}; \

}



error: expected primary-expression before ‘)’ token .DeSWCVersion = { .DeMajor = (SWC_MAJOR_VER), .DeMinor = (SWC_MINOR_VER) }, \







co-pilot suggested code

#define blahblah(SWC_MAJOR_VER, SWC_MINOR_VER) \

{ \

Dt_RECORD_SWC_Identification vSWCinfo = \

{ { (SWC_MAJOR_VER), (SWC_MINOR_VER) } }; \

}


I am getting compilation error if i use this working code in new build environ ment and i f i use co piot suggested code my build is compiling in new build enviroement

https://redd.it/1p1zaaa
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 12, 2026ACCU Overload Journal 195 - October 2026 https://accu.org/journals/overload/overload195 ht…
  2. Oct 12, 2026C++ Contracts C++ contracts are a good thing, why are people saying it's a bad thing? Anyb…
  3. Oct 11, 2026wxWidgets 3.2.12 and 3.3.4 Released https://wxwidgets.org/news/2026/10/wxwidgets-3.2.12-an…
  4. Oct 11, 2026VKRT NES Remaster — an open-source C++20 NES emulator with an observation-driven remasteri…
  5. Oct 11, 2026Right way to test async code https://redd.it/1x2wqgz @r_cpp
  6. Oct 10, 2026Yantra: an LALR(1) parser generator for C++23 Yantra: an LALR(1) parser generator for C++2…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →