warnings

how to fix xcode warning “Expression result unused”

笑着哭i 提交于 2019-12-30 10:09:29
问题 I am doing a registration process with my app where the user enters in a number that I check against my db.. anyway long story short where I pass code into my NSString *startURL have a warning I cannot get rid of, it says "Expression result unused" have you ever experienced anything like this and if so how do I fix it? -(void)startRegConnect:(NSString *)tempRegCode{ //tempRegCode = S.checkString; NSLog(@"tempRegCode from RegConnection =%@",tempRegCode); NSString *code = [[NSString alloc]

C warning conflicting types

狂风中的少年 提交于 2019-12-30 09:38:18
问题 my code is void doc(){ //mycode return; } my warning is conflicting types for 'doc' can anybody solve it. 回答1: In C, if you don't have a prototype for a function when you call it, it is assumed to return an int and to take an unspecified number of parameters. Then, when you later define your function as returning void and taking no parameters, the compiler sees this as a conflict. Depending upon the complexity of your code, you can do something as simple as moving the definition of the

Warn if accessing moved object in C++11 [duplicate]

南笙酒味 提交于 2019-12-30 07:56:55
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: What can I do with a moved-from object? After you called std::move and passed the result to a function, you generally have to assume that accessing the moved object later will result in undefined behavior. Are there tools that can detect those accesses and warn you. For example: { Widget w; foo(std::move(w)); // w may be undefined at this point w.doSomething(); // WARN } At least, gcc 4.7.2 and clang 3.2 with

UIImagePickerController delegate warning

随声附和 提交于 2019-12-30 06:02:07
问题 I've just put a photo picker into my project, and everything works fine. The only thing is it insists on giving me the following warning where I set the delegate - Assigning to 'id<UINavigationControllerDelegate,UIImagePickerDelegate>' from incompatible type 'AddTargetViewController *' I have set up the delegate in the AddTargetViewController.h in the normal way - @interface AddTargetViewController : UIViewController <UIImagePickerControllerDelegate> and I can't see anything wrong. As I say,

Visible Deprecation warning…?

余生颓废 提交于 2019-12-29 07:38:30
问题 I have some data that Im reading from a h5 file as a numpy array and am doing some analysis with. For context, the data plots a spectral response curve. I am indexing the data (and a subsequent array I have made for my x axis) to get a specific value or range of values. Im not doing anything complex and even the little maths I'm doing is pretty basic. However I get the following warning error in a number of places "VisibleDeprecationWarning: boolean index did not match indexed array along

Chrome gives a warning when loading an SVG in an <img>

余生长醉 提交于 2019-12-29 07:31:49
问题 In order to display an SVG image file onto a canvas I have the following line on the HTML: <img id="soundOnImg" src="img/speaker_on.svg" style="display:none"></img> and then to draw it on the canvas I do: ctx2d.drawImage($("#soundOnImg")[0], 10, 10, 200, 200); (using jQuery $() there) This works perfectly except for one annoyance - Chrome gives me the following warning: Resource interpreted as image but transferred with MIME type image/svg+xml. What does this warning mean? I tried using

Chrome gives a warning when loading an SVG in an <img>

与世无争的帅哥 提交于 2019-12-29 07:31:30
问题 In order to display an SVG image file onto a canvas I have the following line on the HTML: <img id="soundOnImg" src="img/speaker_on.svg" style="display:none"></img> and then to draw it on the canvas I do: ctx2d.drawImage($("#soundOnImg")[0], 10, 10, 200, 200); (using jQuery $() there) This works perfectly except for one annoyance - Chrome gives me the following warning: Resource interpreted as image but transferred with MIME type image/svg+xml. What does this warning mean? I tried using

How do I get warnings.warn to issue a warning and not ignore the line?

六月ゝ 毕业季﹏ 提交于 2019-12-29 06:37:10
问题 I'm trying to raise a DeprecationWarning , with a code snippet based on the example shown in the docs. http://docs.python.org/2/library/warnings.html#warnings.warn Official def deprecation(message): warnings.warn(message, DeprecationWarning, stacklevel=2) Mine import warnings warnings.warn("This is a warnings.", DeprecationWarning, stacklevel=2) is None # returns True I've tried removing the stacklevel argument, setting it to negative, 0, 2 and 20000. The warning is always silently swallowed.

Weird error after Perl upgrade: Unable to flush stdout

混江龙づ霸主 提交于 2019-12-28 19:18:10
问题 After upgrading to Perl 5.24.4 we repeatedly get this error in logs (without pointing the filename and line number): Unable to flush stdout: Broken pipe We have no idea what causes this error. Is there any advice how to understand the cause of the error? 回答1: The error comes from perl.c, line 595: PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s", Strerror(errno)); This line is part of perl_destruct, which is called to shut down the perl interpreter at the end of the program. As

Visual Studio Compiler warning C4250 ('class1' : inherits 'class2::member' via dominance)

孤人 提交于 2019-12-28 15:17:19
问题 The following code generates warning C4250. My question is, what's the best solution to it? class A { virtual void func1(); } class B : public A { } class C : public A { virtual void func1(); } class D : public B, public C { } int main() { D d; d.func1(); // Causes warning } According to what I've read it should be possible to do this: class D : public B, public C { using B::func1(); } But, this doesn't actually do anything. The way I've currently solved it is: class D : public B, public C {