GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — token pasting and empty tokens · Issue #259 · cppcheck-opensource/simplecpp

token pasting and empty tokens #259

New issue
Copy link
New issue
Copy link
Open
Open
token pasting and empty tokens#259
Copy link
Labels
bug

Description

@matlo
matlo
opened on Apr 12, 2022
Issue body actions
// test.h

#define SIMPLE(T, NAME) \
   T NAME;

#define ADVANCED(T, PREFIX, NAME, EXTENSION) \
   SIMPLE(T, PREFIX##NAME##EXTENSION)

ADVANCED(int, , foo, )
cppcheck -E test.h
Checking test.h ...
[test.h:6]: (error) failed to expand 'ADVANCED', Invalid ## usage when expanding 'ADVANCED'.
cpp test.h 
# 1 "test.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "test.h"
# 9 "test.h"
int foo;

Activity

  1. matlo commented on Apr 12, 2022

    @matlo
    matlo
    on Apr 12, 2022
    Author
    More actions

    Same result with 0fe0ab6:

    ./simplecpp test.h
    
    test.h:6: syntax error: failed to expand 'ADVANCED', Invalid ## usage when expanding 'ADVANCED': Unexpected token ',foo'
    
  2. firewave
    added
    bug
    on Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.