标签: warnings

警告:条件的长度 > 1 并且只会使用第一个元素

似乎在我的方差计算中na.rm=Tapply函数内:

poolvarcheck=((7037*(apply(yes, 2, var, na.rm=T)))+(5394*(apply(no,2,var,na.rm=T))))/12431

导致此警告消息:

"在 if (na.rm) "na.or.complete" else "everything" 中:条件长度 > 1 并且只使用第一个元素"

我环顾四周,这似乎主要适用于循环或 if 子句,但我想知道 1)这是否会影响我的结果以及如何影响,以及 2)是否有办法避免警告。

warnings r

1
推荐指数
1
解决办法
2536
查看次数

带有 g++ -O2 ( 或 -Os, -O, -O1, ... ) 的模板警告

我收到一些模板和 g++ -Os 的警告。为什么 ?如何使用 -Os -Winline 删除这些警告?

编辑1:G ++ v4.6.1如果我更换uint32_t的无符号整型我的主要错误被纠正:(此bug已报道:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52888

Event.h:109:12: attention : inlining failed in call to ‘uint32_t Event<ParamT>::attach(ListenerT*, bool (ListenerT::*)(ParamT)) [with ListenerT = Listener, ParamT = unsigned int, uint32_t = unsigned int]’: mismatched arguments [-Winline]
Run Code Online (Sandbox Code Playgroud)

编辑 2:以下警告似乎是 g++ 错误(http://gcc.gnu.org/ml/gcc-help/2012-07/msg00029.html)(我没有任何 ~Player() )inlining failed in call to ‘Player::~Player()’: call is unlikely and code size would grow [-Winline]

编辑 3:要删除以前的警告,请添加Player::~Player() __attribute__ ((noinline)) {}

.

测试代码:Event.h

#ifndef …
Run Code Online (Sandbox Code Playgroud)

c++ optimization events templates warnings

1
推荐指数
1
解决办法
960
查看次数

类型中的方法从未在本地使用非私有方法的警告

对于私有方法,我多次收到此警告。如何让 Eclipse 为公共、默认和受保护的方法显示相同(或相似)的警告?

eclipse settings warnings

1
推荐指数
1
解决办法
2万
查看次数

Java Enum 未使用的字段警告

我在这里做错了什么?

public enum Type {
    INFO("INFO"),
    WARN("WARN"),
    ERROR("ERROR"),
    FATAL("FATAL");

    private String value;

    private Type(String aValue) {
        value = aValue;
    }
};  
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

我收到有关值未使用的警告...

我所能想到的就是使用@SupressWarnings,但我是枚举的新手,所以我只是在这里检查是否我做错了什么......有什么想法吗?

java eclipse enums warnings

1
推荐指数
1
解决办法
1452
查看次数

警告:在某些路径上创建 LLDB 目标时出错

我正在 Xcode 6.1 和 iPhone (iOS 8.1) 模拟器上运行一个应用程序。在运行时,我在控制台窗口登录以下:

Warning: Error creating LLDB target at path '/Users/macbook/Library/Developer/Xcode/DerivedData/..Project.app'- 
using an empty LLDB target which can cause slow memory reads from remote devices.
Run Code Online (Sandbox Code Playgroud)

如果我在 Xcode 5.x 和 iPhone (iOS 7.x) 模拟器中运行应用程序,那么控制台上就没有这样的日志。可能是什么原因?如果我将应用程序上传到应用程序商店会不会有问题。

console warnings lldb ios8.1 xcode6.1

1
推荐指数
1
解决办法
6387
查看次数

C警告:函数在定义之前没有使用原型

我在编译C项目时遇到警告:

myFunct在定义之前没有使用原型.

我不明白这个警告,因为原型确实在函数调用之前.

这是我的代码(简化):

void myFunct();

int main(void)
{
   myFunct();
}

void myFunct()
{
   // Whatever
}
Run Code Online (Sandbox Code Playgroud)

c warnings prototype function

1
推荐指数
2
解决办法
2085
查看次数

是什么导致我的React应用程序中出现"Unexpected Fibre popped"警告?

在一个相当复杂的应用程序中,我做了一些与refs 相关的更改,突然开始看到这个警告.

尽管这是一个警告,它正在破坏我的应用程序.

我正在使用React 16.3.0和next.js后端.

导致"意外光纤弹出"警告的原因是什么?

javascript warnings reactjs

1
推荐指数
1
解决办法
3087
查看次数

C++避免对未使用的代码部分发出警告

我想在复杂系统中使用代码部分,它与以下内容等效:

static constexpr int abits = 13;
static constexpr int bbits = 10;

...

int atob(int a) {
    if ( abits == bbits ) return a;
    else if ( abits > bbits ) return a >> (abits-bbits);
    else return a << (bbits-abits);
}
Run Code Online (Sandbox Code Playgroud)

abits并且bbits可能会随着时间而改变(当然是在编译时).即使在调试模式下,最终代码中始终只编译一行.但是,我收到一个关于按负值移动的警告信息.

我使用GCC 7.3.0,并且不想避免负移位值上的所有警告.我想摆脱没有使用的代码的警告.但是,我没有找到它的开关.

c++ warnings

1
推荐指数
1
解决办法
61
查看次数

Perl升级后的奇怪错误:无法刷新stdout

升级到Perl 5.24.4后,我们在日志中反复出现此错误(不指向文件名和行号):

无法冲洗标准输出:管道损坏

我们不知道导致此错误的原因.

有什么建议如何理解错误的原因?

perl warnings runtime-error

1
推荐指数
1
解决办法
477
查看次数

如何使用单行打印捕获的异常的堆栈跟踪?

我想捕获一个异常,但是如果没有捕获则会打印它将打印的相同消息(堆栈跟踪).怎么做?

我试过了

>> myfunctionwitherror
Error using myfunctionwitherror (line 3)
myerror

>> try myfunctionwitherror; catch disp(lasterror), end
Warning: This try-catch syntax will continue to work in R2007b, but may be illegal or may mean something different in future releases of MATLAB.
See MATLAB R2007a Release Notes, "Warning Generated by try-catch" for details. 
  MException with properties:

    identifier: ''
       message: 'myerror'
         cause: {0×1 cell}
         stack: [0×1 struct]

>> try myfunctionwitherror, catch e getReport(e), end
Warning: This try-catch syntax will continue to work in …
Run Code Online (Sandbox Code Playgroud)

matlab warnings exception try-catch stack-trace

1
推荐指数
1
解决办法
193
查看次数