compiler-warnings

“Consider app.config remapping of assembly …” warning in F#

我怕爱的太早我们不能终老 提交于 2019-12-10 01:06:35
问题 After I installed VS11, I started to get the following error: Consider app.config remapping of assembly "FSharp.Core, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "2.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll] to solve conflict and get rid of warning. C:\Windows\Microsoft.NET\Framework\v4.0.30319

How can I disable Haskell warning in small block?

纵饮孤独 提交于 2019-12-10 01:04:45
问题 I want to disable warning only some block of code. I searched Google but only find file scope or global scope disable method. Using cabal file or pragma {-# OPTIONS_GHC #-} Can I disable warning for specific function? 回答1: No, you can't currently in GHC 8.8.1 The {-# OPTIONS_GHC #-} pragma is file-header only and applies to the whole module. And there are no such pragmas (or other ways) to suppress warnings in specific locations. You can check the full list of pragmas in the Haskell user

Warning: Presenting view controllers on detached view controllers is discouraged

妖精的绣舞 提交于 2019-12-09 19:23:13
问题 My situation with this is different than every other example I have been able to find on here. I have a tab based app. On one of the tabs a user is able to press a button that downloads several files from a web server all at once. I make use of NSOperation to perform each of these downloads so that I can utilize the built in dependencies. The downloads are all occurring on a background thread so the app remains responsive. When the final download is complete I put an alertController on screen

Have compiler check the number of array initializers

南笙酒味 提交于 2019-12-09 14:20:06
问题 Initializing an array (in C++, but any solution which works for C will likely work here as well) with less initializers than it has elements is perfectly legal: int array[10] = { 1, 2, 3 }; However, this can be a source of obscure bugs. Is there a way to have the compiler (gcc) check the number of initializers for one specific array, and emit a warning or even an error if declared and actual size don't match? I know I can use int array[] = { 1, 2, 3 }; and could then use static assertions

Does VB.Net have an equivalent to #pragma warning disable/restore?

我们两清 提交于 2019-12-09 02:37:52
问题 I've found a way to disable warnings for an entire VB.NET project, but that is very undesirable. I would like to disable a certain warning for the scope of one method at most. A line-by-line disable and restore would be better. For example, C# has #pragma warning disable (and restore ). Does VB.NET have anything like this? 回答1: If you are using Visual Studio 2015, the answer is yes, yes it does. The syntax is #Disable Warning BC40000 and #Enable Warning BC40000 https://github.com/dotnet

Unchecked Cast Warning when calling 'Class.forName'

纵然是瞬间 提交于 2019-12-08 23:55:12
问题 My code is as follows package com.foo; public class TestComposition { public static void main(String[] args) { try { Class<Foo> fooClass = (Class<Foo>) Class.forName("Foo"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } The assignment within the 'try' block results in a warning stating Type safety: Unchecked cast from Class<capture#1-of ?> to Class<Foo> Why is this? 回答1: Well, to start with let's be clear where the problem is - it's in the cast itself. Here's a shorter

C Returning char[] Warning “returns address of local variable” [duplicate]

孤者浪人 提交于 2019-12-08 23:34:46
问题 This question already has answers here : Returning an address of local variable behaviour [duplicate] (2 answers) Closed 6 years ago . This is a portion of a homework assignment. I am trying to read and return a single line of a file in my method getLine. char *getLine(FILE *input) { char line[30]; if(fgets(line, sizeof(line), input)!=NULL) { return line; }else{ return NULL; } } This would seem to work from what I have been taught regarding pointers, however I am unable to remove the warning

c++; What does the warning “enabled by default” mean during compile?

醉酒当歌 提交于 2019-12-08 21:43:15
问题 My code compiles without error, but what does this mean? etherate.cpp:432:11: warning: deleting array ‘unsigned char broadMAC [6]’ [enabled by default] Its from this line, where I am deleting an unsigned char array; delete [] broadMAC; Is it OK to leave this as it is, if not, how could I improve upon this? Thanks. UPDATE How is broadMAC declared? From about 10 lines previous; unsigned char broadMAC[6] = {destMAC[0], destMAC[1], destMAC[2], destMAC[3], destMAC[4], destMAC[5]}; destMAC is also

How do I get missing prototype warnings from g++?

强颜欢笑 提交于 2019-12-08 19:51:27
问题 I currently have a project that uses g++ to compile it's code. I'm in the process of cleaning up the code, and I'd like to ensure that all functions have prototypes, to ensure things like const char * are correctly handled. Unfortunately, g++ complains when I try to specify -Wmissing-prototypes: g++ -Wmissing-prototypes -Wall -Werror -c foo.cpp cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++ Can someone tell me: 1) Why does gcc this isn't

Casting from AnyObject to CGColor? without errors or warnings

◇◆丶佛笑我妖孽 提交于 2019-12-08 19:34:17
问题 Hello StackOverflow :) I've been running into a weird problem since I upgraded to swift 2.0 I'm trying to set a border color, so I'm writing self.layer.borderColor = borderColor as! CGColor where borderColor is an AnyObject , while self.layer.borderColor is a CGColor? If I write self.layer.borderColor = borderColor as! CGColor I get the warning Treating a forced downcast to 'CGColor' as optional will never produce 'nil' and is recommended to instead use as? If I instead write self.layer