Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
151144 stories
·
33 followers

Learning to read C++ compiler errors: Illegal use of -> when there is no -> in sight

1 Share

A customer reported a problem with a system header file. When they included ole2.h, the compiler reported an error in oaidl.h:

    MIDL_INTERFACE("3127CA40-446E-11CE-8135-00AA004BB851")
    IErrorLog : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE AddError( // error here
            /* [in] */ __RPC__in LPCOLESTR pszPropName,
            /* [in] */ __RPC__in EXCEPINFO *pExcepInfo) = 0;
        
    };

The error message is

oaidl.h(5457,43): error C3927: '->': trailing return type is not allowed after a non-function declarator
oaidl.h(5457,43): error C3613: missing return type after '->' ('int' assumed)
oaidl.h(5457,43): error C3646: 'Log': unknown override specifier
oaidl.h(5457,43): error C2275: 'LPCOLESTR': expected an expression instead of a type
oaidl.h(5457,43): error C2146: syntax error: missing ')' before identifier 'pszPropName'
oaidl.h(5459,60): error C2238: unexpected token(s) preceding ';'

The compiler is seeing ghosts: It’s complaining about things that aren’t there, like -> and Log.

When you see the compiler reporting errors about things that aren’t in the code, you should suspect a macro, because macros can insert characters into code.

In this case, I suspected that there is a macro called AddError whose expansion includes the token ->.

The customer reported that they had no such macro.

I asked them to generate a preprocessor file for the code that isn’t compiling. That way, we can see what is being produced by the preprocessor before it goes into the part of the compiler that is complaining about the illegal use of ->. Is there really no -> there?

The customer reported back that, oops, they did indeed have a macro called AddError. Disabling the macro fixed the problem.

The compiler can at times be obtuse with its error messages, but as far as I know, it isn’t malicious. If it complains about a misused ->, then there is probably a -> that is being misused.

The post Learning to read C++ compiler errors: Illegal use of <TT>-></TT> when there is no <TT>-></TT> in sight appeared first on The Old New Thing.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Can OpenClaw Challenge Copilot in VS Code?

1 Share
A proof of concept used OpenClaw's localhost dashboard inside VS Code's integrated browser to compare it directly with Copilot on the same SKILL.md file, finding that OpenClaw delivered broader, more redesign-oriented analysis while Copilot focused on narrower, maintenance-minded fixes.
Read the whole story
alvinashcraft
13 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Leveraging Claude Code: A Senior Engineer’s Guide to Maximizing AI in Development

1 Share

Most developers treat AI as an advanced search engine, but that approach barely scratches the surface of what tools like Claude Code can achieve. As a senior software engineer, I’ve refined my workflow to make AI a powerful ally in coding, going beyond simple code generation to systemize efficiency and accuracy.

Based on content from Maddy Zhang

In this post, I will walk you through my process of using Claude Code effectively, covering everything from setting up your environment to using AI for code quality assurance. These insights are essential for any developer aiming to work faster and maintain competitiveness in the AI era.

Understanding Claude Code

Claude Code, developed by Anthropic, is more than a bot for writing code. It operates autonomously within your codebase, enabling it to read files, execute commands, and self-correct. This ensures the AI is not just a passive tool but an active participant in your development process.

Mastering Your Setup

Formatting CLAUDE.md for Context

One of the primary steps in utilizing Claude Code effectively is crafting a precise CLAUDE.md file. This document must encapsulate the essence of your project, highlighting tech stacks, conventions, file paths, and operational commands, thus saving time and preventing repetitive exploratory phases for the AI in new sessions.

Leveraging Plan Mode

Before Claude writes any code, initiate Plan Mode. This strategic step allows Claude to develop a comprehensive implementation plan, helping prevent misdirection and misplaced code edits which otherwise result in extended debugging sessions.

Maintaining Context Clarity with Slash Clear

Ensure optimal AI performance by using the backslash clear command frequently. This eliminates stale context, keeping sessions clean and focused on the task at hand.

Advanced Workflows for Efficient AI Integration

Building a Validation Loop

Introduce a self-validation loop into your workflow. By setting up automated checks—builds, tests, type checks—you allow Claude to identify and fix errors autonomously, enhancing code reliability without the need for constant supervision.

Executing Parallel AI Sessions

Utilize Git worktrees or multiple IDE panels to run parallel Claude Code sessions, allowing separate projects or tasks to progress simultaneously without interference.

Employing Subagents for Task Division

Define subagents to manage specialized tasks within your main Claude session. This division of labor ensures that specific areas receive targeted expertise, streamlining complex workflows.

Integrating MCP Servers for Enhanced Interaction

Through MCP servers, enable Claude Code to interact with GitHub, Slack, and other external services, shifting it from a mere code assistant to a proactive component of your engineering team.

Conclusion

By following these strategies, you enhance the capability and efficiency of Claude Code greatly. Structuring your workflow around these principles—from utilizing plan mode to setting up validation loops—will substantially improve both the quality and speed of your development processes. For developers eager to master the intricacies of AI in coding, these guidelines are invaluable.

Remember to like and subscribe if these insights were helpful. Until next time, happy coding!

🔔 Subscribe for more tech career tips & coding content!

Disclaimer: Views expressed in this post are my own and do not represent any current or past employers.

Read the whole story
alvinashcraft
30 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

How product managers ship faster using Replit's agentic workflows

1 Share
This is part 4 of a 6-part series we’re running about how product managers are using AI tools and vibe coding. Written by and for product managers. Summary Requirements docs, decks, and tickets go stale because PMs update them by hand. Agentic workflows fix the source of that problem, not the symptoms. When the prototype is the source of truth, the artifacts around it — briefs, criteria, decks — update as the product changes, not after. Replit Agent 4 runs tasks in parallel and surfaces results for PM review before anything touches the main project.

Read the whole story
alvinashcraft
52 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Reading Notes #692

1 Share

The tech landscape is constantly evolving, and keeping up with the latest developments can be overwhelming. From AI-powered tools like Ollama and OpenClaw, to new ways of programming with Aspire Docs and Azure CLI, it seems like there's always something new to explore. In this edition of Reading Notes, I'll share some of the interesting things that caught my eye recently, from AI advancements to developer tools and beyond.


Suggestion of the week

AI

Programming

Cloud

Miscellaneous


Sharing my Reading Notes is a habit I started a long time ago, where I share a list of all the articles, blog posts, podcasts and books that catch my interest during the week.

If you have interesting content, share it!

~frank
Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete

How I set up Claude Code in iTerm2 to launch all my AI coding projects in one click

1 Share
Managing multiple Claude Code projects doesn't have to be chaotic. My iTerm2 setup dramatically reduces friction in my daily AI-assisted coding workflows - here's how.
Read the whole story
alvinashcraft
3 hours ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories