Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P protocol-fuzzer-ce
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • security-productssecurity-products
  • protocol-fuzzer-ce
  • Merge requests
  • !7
The source project of this merge request has been removed.

dev: change StaticAssert::assert() to ::s_assert()

Closed Gold Star requested to merge (removed):static_assert into main Mar 10, 2021
  • Overview 4
  • Pipelines 0
  • Changes 1

I struggled with this one for a bit but rather than disable the assert() macro which might be used elsewhere, I believe it's best to just not use assert as the function name.

When compiling for windows, assert is a macro that requires a scalar expression, https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/assert-macro-assert-wassert?view=msvc-160 The assert() macro can be disabled with /DNDEBUG or #define NDEBUG but I think it will be cleaner to not have any overlap here. The error is:

   [ 99/224] | win_x86_debug | bblocks32 | cxx | ['bblocks.cpp'] | ['bblocks.cpp.1.o']
   bblocks.cpp
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(49): error C2220: warning treated as error - no 'object' file generated
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(49): warning C4003: not enough actual parameters for macro 'assert'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(49): error C2059: syntax error: ')'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(49): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(50): error C2143: syntax error: missing ')' before ';'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(50): error C2059: syntax error: ')'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(50): error C2238: unexpected token(s) preceding ';'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(482): error C2864: 'StaticAssert<true>::stopping': a static data member with an in-class initializer must have non-volatile const integral type
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(482): note: type is 'INT'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(528): warning C4003: not enough actual parameters for macro 'assert'
   c:\users\user\desktop\protocol-fuzzer-ce\core\basicblocks\bblocks.cpp(562): fatal error C1004: unexpected end-of-file found
Edited Mar 10, 2021 by Gold Star
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: static_assert