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

Andreas Ostermeyer via clangd-dev clangd-dev at lists.llvm.org
Wed Jul 3 22:03:38 PDT 2019


Hi Alex,

thanks for rapid responding.

No, compilers (both clang and gcc) work like expected. It’s only clangd that simply ignores the constant-string-class flag (neither in compile_commands.json nor in compile_flags.txt).

Cheers,

Andreas

> On 3. Jul 2019, at 20:16, Alex L <arphaman at gmail.com> wrote:
> 
> Hi Andreas,
> 
> Are you getting this warning when building your code? Which compiler are you building your code with?
> 
> Cheers,
> Alex
> 
> 
> On Wed, 3 Jul 2019 at 10:57, Andreas Ostermeyer via clangd-dev <clangd-dev at lists.llvm.org <mailto: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 <mailto:clangd-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev <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/20190704/092bf431/attachment.html>


More information about the clangd-dev mailing list