草庐IT

compiler-warnings

全部标签

解决:xxx has been compiled by a more recent version of the Java Runtime (class file version 55.0)

原因当前类是由jdk1.8版本编译,当前运行环境低于jdk1.8,故出现当前情况。javacode和name对应关系49=Java550=Java651=Java752=Java853=Java954=Java1055=Java1156=Java1257=Java1358=Java14解决方案升级当前项目jdk版本号,或者降低引用库编译的jdk版本号android{ ...compileOptions{sourceCompatibilityJavaVersion.VERSION_1_8targetCompatibilityJavaVersion.VERSION_1_8}}

c++ - 警告 C4172:返回对绑定(bind)到局部变量的 const std::string 的引用。它有多安全?

我刚刚在工作中构建我们的一个项目,我看到添加了一个新功能:conststd::string&ClassName::MethodName()const{return"";}编译器给出警告:WarningC4172:returningaddressoflocalvariableortemporary我认为编译器是对的。这个函数的安全性如何?请注意,该函数不会返回constchar*,这没有问题,因为字符串文字具有静态存储持续时间。它返回对conststd::string的引用 最佳答案 是的,它不安全。返回局部变量或临时变量的地址并取消

c++ - "most important const"与 auto_ptr : Why the code does not compile?

以下代码无法在VisualC++2008或2010上编译:#includestructA{};std::auto_ptrfoo(){returnstd::auto_ptr(newA);}conststd::auto_ptrbar(){returnstd::auto_ptr(newA);}intmain(){conststd::auto_ptr&a=foo();//mostimportantconstconststd::auto_ptr&b=bar();//errorC2558://class'std::auto_ptr'://nocopyconstructoravailableorco

c++ - 为什么 gcc 的选项 "-Wstrict-prototypes"对 C++ 无效?

这是一个警告,我和网上的很多人,请参阅在C++代码上运行gcc时:cc1plus:warning:commandlineoption"-Wstrict-prototypes"isvalidforAda/C/ObjCbutnotforC++警告文本非常清楚:'C++'不在集合[Ada/C/ObjC]中,所以我完全不知道为什么gcc在编译C++代码时会发出此警告。(仅供引用,尽管有C++代码,我们仍打开此标志的原因是因为它主要是C代码,我们选择了严格(高级)警告选项列表,但我们添加了一些C++代码。我的问题是:为什么这个警告对C++无效?警告选项的gcc文档,来自http://gcc.gn

c++ - -错误=格式: how can the compiler know

我故意写错了代码printf("%d%d",1);使用g++和-Werror=format编译。编译器给出了这个非常令人印象深刻的警告:error:format'%d'expectsamatching'int'argument[-Werror=format]据我所知,编译器无法判断代码是错误的,因为格式字符串直到运行时才被解析。我的问题:编译器是否具有启动printf和类似libc函数的特殊功能,或者这是我可以用于我自己的函数的功能?字符串文字? 最佳答案 AsfarasIcansee,there'snowaythecompiler

C++;编译时警告 "enabled by default"是什么意思?

我的代码编译没有错误,但这意味着什么?etherate.cpp:432:11:warning:deletingarray‘unsignedcharbroadMAC[6]’[enabledbydefault]从这一行开始,我正在删除一个无符号字符数组;delete[]broadMAC;保持原样是否可以,如果不能,我该如何改进?谢谢。更新broadMAC是如何声明的?从大约10行开始;unsignedcharbroadMAC[6]={destMAC[0],destMAC[1],destMAC[2],destMAC[3],destMAC[4],destMAC[5]};destMAC也是一个u

vue2/3 - 报错You may use special comments to disable some warnings.(// eslint-disable-next-line解决方法教程)

错误提示在vue2/3项目开发中,运行或打包时出现如下报错信息,提供详细解决方法。oumayusespecialcommentstodisablesomewarnings.Use//eslint-disable-next-linetoignorethenextline.Use/eslint-disabletoignoreallwarningsinafile.只要你和我一样报错,就可以解决掉这个问题!解决教程其实,

ios - 在 Xcode 8.3 beta_2 上为体系结构 'com.apple.compilers.llvm.clang.1_0' 选择了不受支持的编译器 'x86_64'

我对我遇到的这个错误感到恼火,有趣的是网上发布的解决方案似乎都不适合我。Unsupportedcompiler'com.apple.compilers.llvm.clang.1_0'selectedforarchitecture'x86_64'我还找到了一个解决方案,有人说要改变Xcode>Target>BuildSettings>BuildOptions>CompilerforC/C++/Objective-CSelectDefaultcompiler(AppleLLVMx.y)我找不到这个选项,看这个:如有任何帮助,我们将不胜感激。 最佳答案

ios - Xcode 9.1 : module compiled with Swift 4. 0 Swift 3.2.2无法导入

我将xCode从9.0.1更新到9.1。之前一切正常,但现在,当我尝试构建我的项目(使用迦太基)时出现此错误:用Swift4.0编译的模块不能导入Swift3.2.2(或SWIFT4用户的4.0.2)不需要让你知道这个模块,因为它不依赖于它(因为当我评论相关的导入行时,错误他错放在下一个导入中,所以对于另一个模块)。我尝试了我所看到的一切:清理项目清理Carthage文件夹清理派生数据文件夹:rm-rf~/Library/Caches/org.carthage.CarthageKit/DerivedData使用Carthage更新:carthageupdate--platformiOS

WARN: Establishing SSL connection without server‘s identity verification is not recommended. Acco...

问题描述:TueSep1316:30:02CST2022WARN:EstablishingSSLconnectionwithoutserver'sidentityverificationisnotrecommended.AccordingtoMySQL5.5.45+,5.6.26+and5.7.6+requirementsSSLconnectionmustbeestablishedbydefaultifexplicitoptionisn'tset.ForcompliancewithexistingapplicationsnotusingSSLtheverifyServerCertificate