[clangd-dev] Flag constant-string-class in clangd

Sam McCall via clangd-dev clangd-dev at lists.llvm.org
Wed Jul 3 12:08:28 PDT 2019


Hi Andreas,

Can you provide a minimal source file that exhibits the problem, and
explain how you're specifying the -fconstant-string-class flag? (It should
be in the compile_commands.json or compile_flags.txt file)

It sounds like what you're describing should work, but I think we need more
detail to reproduce the issue.

 I cant really speak to the layering between objc the language and the
Foundation etc libraries. I'm sympathetic to the frustration but
realistically clangd won't diverge from clang here, so this would be an
issue for experts on cfe-dev.

Cheers, Sam


On Wed, Jul 3, 2019, 7:57 PM Andreas Ostermeyer via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> clangd developers,
>
> currently I’m working on an own small footprint Objective-C Class library
> completely unrelated to Cocoa. I use clangd [version 8.0.0
> (tags/RELEASE_800/final)] from homebrew as the language server in my IDE.
>
> Unfortunately I can’t clangd persuade to accept my own as a constant
> string class with the flag "-fconstant-string-class=NGStringLiteral".
> Ignoring the flag it complains: “Incompatible pointer types initializing
> 'NGStringLiteral *' with an expression of type 'NSString *’”.
>
> To quiet this I declared ’NSString’ as ’NGStringLiteral’ (“typedef
> NSString NGStringLiteral”). Now clangd warns: “Incompatible pointer types
> initializing 'NSString *' (aka 'NGStringLiteral *') with an expression of
> type 'NSString *’”!
>
> That’s annoying - like all the hard-wired Cocoa aka Apple stuff in clang
> software. Objective-C is an independent general purpose programming
> language. Not a Cocoa development tool and not an Apple software product.
> This should be true for clang, too.
>
> So, what can I do (or what can you do) to get rid of - at least - this?
>
> Thanks in advance.
>
> Best regards,
>
> Andreas Ostermeyer
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20190703/c2e72a9a/attachment.html>


More information about the clangd-dev mailing list