11
голосов
3ответов
3073 просмотров

Необязательный аргумент нельзя стереть?

Я хотел иметь хвостовую рекурсивную версию List.map, поэтому написал свою собственную.Вот он: let rec list_map f l ?(accum=[])= match l with head :: tail -> list_map f tail ~accum:(head :: accum) | [] -> accum;; Когда я компилирую эту функцию, я получаю: File "main.ml...

5
голосов
2ответов
4664 просмотров

Как бороться с предупреждениями -Wconversion от GCC?

Я создаю свой проект с предупреждением GCC -Wconversion. (gcc (Debian 4.3.2-1.1) 4.3.2) на 64-битной ОС / оборудовании GNU / Linux. Я нахожу это полезным для определения, где я смешал типы или потерял ясность в отношении того, какие типы следует использовать. Это не так полезно в большинстве ...

0
голосов
3ответов
597 просмотров

ненужное (?) предупреждение Xcode

Я запускаю Xcode в OS X 10.6 на Core 2 Duo.Вот короткая программа: #include <stdio.h> int main () { long a = 8589934592L; printf("a = %li\n", a); return 0; } Когда я компилирую это из командной строки (gcc -pedantic), я не получаю ошибок или предупреждений.Когда я компи...

8
голосов
4ответов
690 просмотров

Почему это предупреждение от компилятора IBM XL C / C ++?

Вот минимальный пример кода, иллюстрирующий проблему: #include <iostream> class Thing { // Non-copyable Thing(const Thing&); Thing& operator=(const Thing&); int n_; public: Thing(int n) : n_(n) {} int getValue() const { return n_;} }; void show(const T...

1
голосов
2ответов
579 просмотров

Compiler warning with nested vectors of depth 3 or more

I am trying to use a class member that uses nested vectors of depth 3: vector> classVariable_; However, I then get compiler warnings throughout my code when I try do something as simple as classVariable_.clear(): /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_vector.h: In member fun...

3
голосов
3ответов
1223 просмотров

Custom Compiler Warnings in Visual Studio 2008

Custom Compiler Warnings and C#: Create custom warning in Visual Studio if certain method is used in source code haven't helped as they deal with code that is under the author's control. We are using a 3rd party suite of UI controls (DevExpress) in our software and I want to generate a warning w...

107
голосов
8ответов
167739 просмотров

Java Class.cast() vs. cast operator

Having being taught during my C++ days about evils of the C-style cast operator I was pleased at first to find that in Java 5 java.lang.Class had acquired a cast method. I thought that finally we have an OO way of dealing with casting. Turns out Class.cast is not the same as static_cast in C++....

53
голосов
9ответов
79632 просмотров

How can I suppress javac warnings about deprecated api?

When I compile, javac outputs: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.` I wish to suppress this warning. Trying -Xlint:none does not seem to help.

3
голосов
5ответов
4127 просмотров

How to get rid of C4800 warning produced by boost::flyweight in VS2008

I get a warning when compiling below code in VS2008 with MFC turned on. Boost version 1.39 include "boost/flyweight.hpp" include "boost/flyweight/key_value.hpp" class Foo { public: Foo(const CString& item) : mfoo(item) {} const CString& getkeyvalue() const {return mfoo;} pri...

3
голосов
1ответов
1497 просмотров

Scala: comparing fresh objects

I was browsing scala tests and I don't understand why the compiler produces a warning when you compare "two fresh objects". This is the test' outputs: http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/test/files/neg/checksensible.check Example: checksensible.scala:12: warning: comparing a ...

1
голосов
3ответов
1824 просмотров

C++: Casting for user defined types

How can I get the same handeling of casting for user-defined types as built in, eg: float a = 5.4; std::string s = a;//error, no conversion avaible int x = a;//warning, possible data loss int y = (int)a;//fine int z = static_cast<int>a;//fine float b = c;//warning, possible data loss Now...

1
голосов
1ответов
711 просмотров

Warning: passing argument from distinct Objective-C type

I am currently trying to compile OCMock with GCC4.2 (original: 4.0) and start getting the following warning: warning: passing argument 1 of 'partialMockForObject:' from distinct Objective-C type the calling method is: - (void)forwardInvocationForRealObject:(NSInvocation *)anInvocation ...

1
голосов
2ответов
461 просмотров

Xcode - why didn't this show a warning?

I've got a class I wrote earlier in the year, pre 3.0, that implemented the UIImagePickerControllerDelegate protocol. In it, I implemented the imagePickerController:didFinishPickingImage:editingInfo: method, which is deprecated in the 3.0 SDK. The thing is, I noticed this just by cruising throu...

5
голосов
3ответов
44669 просмотров

C# could not load file or assembly...system cannot find file specified

Writing a routine WinForms app that references a few custom libraries written by myself. I am building one particular library which depends on another library and, when I do, I get the following warning message: "Could not load file or assembly 'RHLib' Version 1.0.0.0, Culture=neutral, Pub...

2
голосов
1ответов
2772 просмотров

What is a manifest authoring warning?

Anyone knows what this mean? Care to shed some light? Got this warning while compiling a MFC project in VS2005. ..\..\..\Shared\res\zenOn_common.manifest : manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v3".

100
голосов
7ответов
41886 просмотров

How to detect unused methods and #import in Objective-C

After working a long time on an iPhone app, I realized that my code is quite dirty, containing several #import and methods that are not called or useful at all. I would like to know if there's any compiler directive or way to detect those useless lines of code. Does Xcode have any tool to detect...

1
голосов
4ответов
5600 просмотров

Why am I getting a deprecated warning in XCode

I am getting a warning about setText method when I am not even using it. Why does XCode display this warning message? alt text http://www.angryhacker.com/toys/deprecated.jpg

1
голосов
2ответов
1528 просмотров

w8004 compiler warning BDS6 c/c++

It is a best practise to initialise a variable at the time of declaration. int TMyClass::GetValue() { int vStatus = OK; // A function returns a value vStatus = DoSomeThingAndReturnErrorCode(); if(!vStatus) //Do something else return(vStatus); } In the debug m...

4
голосов
2ответов
758 просмотров

Java: Generic casting down generates warning, why?

I don't understand why the following code generates a warning. interface Generic<T> { } interface A { } class B { Generic<A> c; <T extends A> B(Generic<T> a) { c = (Generic<A>) a; //warning here } } //Unchecked cast from Generic<T> to ...

32
голосов
8ответов
18546 просмотров

Is there a way to suppress warnings in C# similar to Java's @SuppressWarnings annotation?

Is there a way to suppress warnings in C# similar to Java's @SuppressWarnings annotation? Failing that, is there another way to suppress warnings in Visual Studio?

1
голосов
1ответов
328 просмотров

Ensuring correct Double Pointer passing method at compile-time in C++

in the past we encountered various memory-leaks in our software. We found out that these happened mostly due to incorrect usage of our own "free"-Methods, which free Queue-Message-Data and the likes. The problem is, in our deepest tool-functions there are two methods to free up dynamically allo...

26
голосов
4ответов
12648 просмотров

Bad path warning, where is it coming from?

When I compile my project with compiler warnings (JDK 1.5) I get a bunch of bad path element warnings: Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\junit.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\jdom.jar": no such fi...

1
голосов
2ответов
248 просмотров

Warning: "File '../ControllerName/ActionMethodName' was not found."

We're seeing the above warning on a View's form post... <form action="../ControllerName/ActionMethodName" method="post"> Technically this warning is correct - there is no such file, but as we're using ASP.NET MVC this check isn't really sufficient. This warning isn't stopping our applic...

46
голосов
6ответов
26393 просмотров

C++ Boost: what's the cause of this warning?

I have a simple C++ with Boost like this: #include <boost/algorithm/string.hpp> int main() { std::string latlonStr = "hello,ergr()()rg(rg)"; boost::find_format_all(latlonStr,boost::token_finder(boost::is_any_of("(,)")),boost::const_formatter(" ")); This works fine; it replaces every...

0
голосов
1ответов
236 просмотров

Delphi warnings are bugging me

In one of my component sets, I am getting a number of warnings at compile time: Method Create (Clear, DrawTab) hides virtual method of base type ControlX. My problem is that I don't know enough about virtual methods and Delphi to know how to fix this properly (we have the source code). Doe...

11
голосов
3ответов
4149 просмотров

Why is VC++ C4150 (deletion of pointer to incomplete type) only a warning?

Of course, warning must be treated, but why is VC++ C4150 (deletion of pointer to incomplete type) only a warning?

1
голосов
3ответов
3312 просмотров

Protocols with optional properties?

The short version is that I have a protocol which has an optional parameter. When I build a class that implements it with the iPhone SDK 3.x it compiles just fine, with no errors or warnings. When I used the 2.x SDK I get the following warning: Class.m:68: warning: property 'field' requires meth...

1
голосов
3ответов
696 просмотров

Xcode seems to not want to include my class

So, I have a class called MazeCell which is declared in "MazeCell.h" #import <Foundation/Foundation.h> enum { MazeCellEdgeWall = 0, MazeCellEdgeGate = 1, MazeCellEdgeExit = 2 }; typedef NSUInteger MazeCellEdge; @interface MazeCell : NSObject { MazeCellEdge left; MazeC...

272
голосов
9ответов
151425 просмотров

What is the list of valid @SuppressWarnings warning names in Java?

What is the list of valid @SuppressWarnings warning names in Java? The bit that comes in between the ("") in @SuppressWarnings("").

5
голосов
1ответов
991 просмотров

Visual Studio: Warn on Missing XML Documentation for Private and Internal Members

I am using Visual Studio 2005 (VS.8.0) and I am looking to enforce the requirement that all class members, not just the public ones, be documented. While trivial to setup Visual Studio to generate warnings when public, protected, or internal protected members are not documented, I am looking for ...