Search Results

Search found 5842 results on 234 pages for 'compiler warnings'.

Page 19/234 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • "The left hand side of an assignment must be a variable" due to extra parentheses

    - by polygenelubricants
    I know why the following code doesn't compile: public class Main { public static void main(String args[]) { main((null)); // this is fine! (main(null)); // this is NOT! } } What I'm wondering is why my compiler (javac 1.6.0_17, Windows version) is complaining "The left hand side of an assignment must be a variable". I'd expect something like "Don't put parentheses around a method invokation, dummy!", instead. So why is the compiler making a totally unhelpful complaint about something that is blatantly irrelevant? Is this the result of an ambiguity in the grammar? A bug in the compiler? If it's the former, could you design a language such that a compiler would never be so off-base about a syntax error like this?

    Read the article

  • sqlite compiler errors

    - by mspoerr
    Hello, when including "sqlite.c" into my project, I get lots of compiler errors: error C2027: use of undefined type "_ht" d:\...\sqlite3.c line 19556 ... fatal error C1003: Errors in the program are too numerous to allow recovery. The compiler must terminate. When inlcuding "sqlite.c" into an empty test project, I have no problems. I already compared project settings and there are no big differences. How can I troubleshoot this problem? Is there anyone who had the same issue? Thanks, mspoerr

    Read the article

  • Can standard Sun javac do incremental compiling?

    - by calavera.info
    Recently I started to use Eclipse's java compiler, because it is significantly faster than standard javac. I was told that it's faster because it performs incremental compiling. But I'm still a bit unsure about this since I can't find any authoritative documentation about both - eclispse's and sun's - compilers "incremental feature". Is it true that Sun's compiler always compiles every source file and Eclipse's compiler compile only changed files and those that are affected by such a change?

    Read the article

  • VC7.1 C1204 internal compiler error

    - by Nathan Ernst
    I'm working on modifying Firaxis' Civilization 4 core game DLL. The host application is built using VC7, hence the constraint (source not provided for the host EXE). I've been working on rewriting a large chunk of the code (focusing on low-hanging performance issues & memory leaks). I recently ran into an internal compiler error when trying to mod the code to use an array class instead of dynamically allocated 2-d arrays, I was going to use matrices from the boost lib (Civ4 is already using boost, so why not?). Basically, the issue comes down to: if I include "boost/numeric/ublas/matrix.hpp", I run into an internal compiler error C1204. MSDN has this to say: MSDN C1204 KB has this to say: KB 883655 So, I'm curious, is it possible to solve this error without a KB/SP being applied and dramatically reducing the complexity of the code? Additionally, as VC7 is no longer "supported", does anyone have a valid (supported) link for a VC7 service pack?

    Read the article

  • SqlParameter contructor compiler overload choice

    - by Ash
    When creating a SqlParameter (.NET3.5) or OdbcParameter I often use the SqlParameter(string parameterName, Object value) constructor overload to set the value in one statement. When I tried passing a literal 0 as the value paramter I was initially caught by the C# compiler choosing the (string, OdbcType) overload instead of (string, Object). MSDN actually warns about this gotcha in the remarks section, but the explanation confuses me. Why does the C# compiler decide that a literal 0 parameter should be converted to OdbcType rather than Object? The warning also says to use Convert.ToInt32(0) to force the Object overload to be used. It confusingly says that this converts the 0 to an "Object type". But isn't 0 already an "Object type"? The Types of Literal Values section of this page seems to say literals are always typed and so inherit from System.Object. This behavior doesn't seem very intuitive given my current understanding? Is this something to do with Contra-variance or Co-variance maybe?

    Read the article

  • C++ enumerations and compiler dependency

    - by dougie
    I currently have code with an enum where one value is set and the rest are left to be set by the compiler using the previous value +1, or so I hope. Is this functionality within an enumerated type compiler dependant, an example is below to clarify. enum FUNC_ERROR_CODE { FUNC_SUCCESS, FUNC_ERROR_1 = 24, FUNC_ERROR_2, FUNC_ERROR_3 } Is it safe to assume that FUNC_ERROR_2 will have the value 25 and FUNC_ERROR_3 will have the value 26, regardless of compliler used. I'm coding this so as a function can return an integer value, 0 is always success and any other value can signify failure.

    Read the article

  • How to set that compiler flag?

    - by mystify
    Shark told me this: This instruction is the start of a loop that is not aligned to a 16-byte address boundary. For optimal performance, you should align the start of a hot loop using a compiler directive. With gcc 3.3 or later, use the -falign-loops=16 compiler flag. for (int i=0; i < 4; i++) { // line with the info //...code } How would I set that flag, and does it really improve performance?

    Read the article

  • Visual Studio 2005 - VC++ compiler C1001 on Windows 7

    - by Fritz H
    When I try to build a simple "Hello World" C++ app on Windows 7 Beta, using Visual Studio 2005 (VC++2005) I get a rather generic error C1001 error (Internal compiler error) The compiler seems to just crash, and Windows pops up its (un)helpful This program has stopped working dialog. The file it complains about is mcp1.cpp. Has anyone come across this before? Cheers, Fritz EDIT: The code is: #include <iostream> int main(int argc, char** argv) { std::cout << "Hello!"; return 0; } EDIT 2: I have installed SP1 as well as SP1 for Vista. VS popped up a warning saying it needs SP1 for Vista, but installing it makes no difference. No ideas about what I can possibly do to fix this?

    Read the article

  • Real thing about "->" and "."

    - by fsdfa
    I always wanted to know what is the real thing difference of how the compiler see a pointer to a struct (in C suppose) and a struct itself. struct person p; struct person *pp; pp->age, I always imagine that the compiler does: "value of pp + offset of atribute "age" in the struct". But what it does with person.p? It would be almost the same. For me "the programmer", p is not a memory address, its like "the structure itself", but of course this is not how the compiler deal with it. My guess is it's more of a syntactic thing, and the compiler always does (&p)->age. I'm correct?

    Read the article

  • Getting closure-compiler and Node.js to play nice

    - by bukzor
    Are there any projects that used node.js and closure-compiler (CC for short) together? The official CC recommendation is to compile all code for an application together, but when I compile some simple node.js code which contains a require("./MyLib.js"), that line is put directly into the output, but it doesn't make any sense in that context. I see a few options: Code the entire application as a single file. This solves the problem by avoiding it, but is bad for maintenance. Assume that all files will be concatenated before execution. Again this avoids the problem, but makes it harder to implement a un-compiled debug mode. I'd like to get CC to "understand" the node.js require() function, but that probably can't be done without editing the compiler itself, can it?

    Read the article

  • Building Boost with LSB C++ Compiler

    - by Alex Farber
    I want to build my program with LSB C++ Compiler from the Linux Standard Base http://www.linuxfoundation.org/collaborate/workgroups/lsb. Program depends on the Boost library, built with gcc 4.4 version. Compilation fails. Is it possible to build the Boost library with LSB C++ Compiler? Alternatively, is it possible to build the Boost library with some old gcc version, what version is recommended? My final goal is to get my executable and third-party Boost libraries running on most Linux distributions. Generally, what can be done to get better binary compatibility for Linux distributions, developing C++ closed-source application depending on the Boost library?

    Read the article

  • Why is 'using' improving C# performances

    - by Wernight
    It seems that in most cases the C# compiler could call Dispose() automatically. Like most cases of the using pattern look like: public void SomeMethod() { ... using (var foo = new Foo()) { ... } // Foo isn't use after here (obviously). ... } Since foo isn't used (that's a very simple detection) and since its not provided as argument to another method (that's a supposition that applies to many use cases and can be extended), the compiler could automatically call Dispose() without the developper requiring to do it. This means that in most cases the using is pretty useless if the compiler does some smart job. IDisposable seem low level enough to me to be taken in account by a compiler. Now why isn't this done? Wouldn't that improve the performances (if the developpers are... dirty).

    Read the article

  • Compiler error when using abstract types

    - by Dylan
    I'm trying to implement a "protocol helper" trait that is responsible for matching up Prompts and Responses. The eventual goal is to have an object that defines the various Prompt and Response classes as subclasses of a sealed trait, then have a class that mixes in the ProtocolSupport trait for that Protocol object. The problem is that my current approach won't compile, even though I'm fairly sure it should. Here's a distilled version of what I've got: trait Protocol { type Response type Prompt <: BasePrompt trait BasePrompt { type Data def validate(response: Response): Validated[Data] } } trait ProtocolSupport[P <: Protocol] { def foo(prompt: P#Prompt, response: P#Response) = { // compiler error prompt.validate(response) } } The compiler doesn't like the response as an argument to prompt.validate: [error] found : response.type (with underlying type P#Response) [error] required: _4.Response where val _4: P [error] prompt.validate(response) [error] ^ This isn't very helpful.. it seems to say that it wants a P.Response but that's exactly what I'm giving it, so what's the problem?

    Read the article

  • Invalid receiver type 'NSUInteger'

    - by CJ
    I have a Core Data entity whose header file looks like this: @interface MyEntity : NSManagedObject { } @property (nonatomic, retain) NSNumber * index; @end And it's implementation file looks like this: @implementation MyEntity @dynamic index; @end Now, I have a piece of code that looks like this: NSArray* selectedObects = [myEntityArrayController selectedObjects]; NSUInteger theIndex = [[[selectedObects objectAtIndex:0] index] unsignedIntegerValue]; The 'myEntityArrayController' object is a NSArrayController which manages all entities of MyEntity. This code executes correctly, however XCode always gives the warning "Invalid receiver type 'NSUInteger'" for the last line of code. For some reason, XCode thinks that the index method returns a NSUInteger. I'm not sure why it thinks this, because 'objectAtIndex' returns an object of type 'id'. I've cleaned the project several times, and these warnings have hung around for a while. Any suggestions are appreciated.

    Read the article

  • What is the proper way to resolve Eclipse warning "isn't parameterized"?

    - by Morinar
    I'm trying to clean up some warnings in some old Java code (in Eclipse), and I'm unsure what the proper thing to do is in this case. The block looks more or less like this: Transferable content = getToolkit().getSystemClipboard().getContents( null ); java.util.List clipboardFileList = null; if( content.isDataFlavorSupported( DataFlavor.javaFileListFlavor ) ) { try { clipboardFileList = (java.util.List)content.getTransferData( DataFlavor.javaFileListFlavor); } /* Do other crap, etc. */ } The List generates a warning as it isn't parameterized, however, if I parameterize it with <File>, which I'm pretty sure is what it requires, it complains that it can't convert from Object to List<File>. I could merely suppress the unchecked warning for the function, but would prefer to avoid that if there is a "good" solution. Thoughts?

    Read the article

  • What is the proper way to resolve this Eclipse warning?

    - by Morinar
    I'm trying to clean up some warnings in some old Java code (in Eclipse), and I'm unsure what the proper thing to do is in this case. The block looks more or less like this: java.util.List clipboardFileList = null; if( content.isDataFlavorSupported( DataFlavor.javaFileListFlavor ) ) { try { clipboardFileList = (java.util.List)content.getTransferData( DataFlavor.javaFileListFlavor); } /* Do other crap, etc. */ } The List generates a warning as it isn't parameterized, however, if I parameterize it with <File>, which I'm pretty sure is what it requires, it complains that it can't convert from Object to List<File>. I could merely suppress the unchecked warning for the function, but would prefer to avoid that if there is a "good" solution. Thoughts?

    Read the article

  • Default taglibs used within included JSPs for editing

    - by lostiniceland
    Hello everyone Within Eclipse's jsp-editor, as you all know, I get code-assistance for external taglibs once I defined them. In the project I am working on now a lot of jsps are just included and have no taglib definition in the top which gives me a lot of editor warnings. In the deployment this doesnt matter because the taglibs are defined in the head-jsp. Is there a way that I can define default taglibs within a project so the eclipse editor will give me code-assist even though I dont include the taglib in each file again?

    Read the article

  • Catch all exceptions in Scala 2.8 RC1

    - by Michel Krämer
    I have the following dummy Scala code in the file test.scala: class Transaction { def begin() {} def commit() {} def rollback() {} } object Test extends Application { def doSomething() {} val t = new Transaction() t.begin() try { doSomething() t.commit() } catch { case _ => t.rollback() } } If I compile this on Scala 2.8 RC1 with scalac -Xstrict-warnings test.scala I'll get the following warning: test.scala:16: warning: catch clause swallows everything: not advised. case _ => t.rollback() ^ one warning found So, if catch-all expressions are not advised, how am I supposed to implement such a pattern instead? And apart from that why are such expressions not advised anyhow?

    Read the article

  • Java generics SuppressWarnings("unchecked") mystery

    - by Johannes Ernst
    Why does code alternative(1) compile without warnings, and code alternative(2) produce an "unchecked cast" warning? Common for both: class Foo<T> { Foo( T [] arg ) { } } Alternative (1): class Bar<T> extends Foo<T> { protected static final Object [] EMPTY_ARRAY = {}; @SuppressWarnings("unchecked") Bar() { super( (T []) EMPTY_ARRAY ); } } Alternative (2): class Bar<T> extends Foo<T> { @SuppressWarnings("unchecked") Bar() { super( (T []) EMPTY_ARRAY ); } protected static final Object [] EMPTY_ARRAY = {}; } Alternative (2) produces: javac -Xlint:unchecked Foo.java Bar.java Bar.java:4: warning: [unchecked] unchecked cast super( (T []) EMPTY_ARRAY ); ^ required: T[] found: Object[] where T is a type-variable: T extends Object declared in class Bar 1 warning This is: java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

    Read the article

  • What are the implications of having an "implicit declaration of function" warning in C?

    - by SiegeX
    As the question states, what exactly are the implications of having the 'implicit declaration of function' warning? We just cranked up the warning flags on gcc and found quite a few instances of these warnings and I'm curious what type of problems this may have caused prior to fixing them? Also, why is this a warning and not an error. How is gcc even able to successfully link this executable? As you can see in the example below, the executable functions as expected. Take the following two files for example: file1.c #include <stdio.h> int main(void) { funcA(); return 0; } file2.c #include <stdio.h> void funcA(void) { puts("hello world"); } Compile & Output $ gcc -Wall -Wextra -c file1.c file2.c file1.c: In function 'main': file1.c:3: warning: implicit declaration of function 'funcA' $ gcc -Wall -Wextra file1.o file2.o -o test.exe $ ./test.exe hello world

    Read the article

  • Error message when trying to insert method into touchesBegan

    - by Rob
    I am trying to create a new method within my TapDetectingImageView file and it's giving me a warning that it cannot find the method even though I have it declared in the .h file. The specific three warnings all point to the @end line in the .m file when I build it and they say: "Incomplete implementation of class 'TapDetectingImageView' ; 'Method definition for '-functionA:' not found" ; "Method definition for '-functionB:' not found" What am I missing? Am I not allowed to do this in a protocol file like TapDetectingImageView? In my .h file is: @interface TapDetectingImageView : UIImageView <AVAudioPlayerDelegate> { id <TapDetectingImageViewDelegate> delegate; } @property (nonatomic, assign) id <TapDetectingImageViewDelegate> delegate; -(void) functionA:(NSString*)aVariable; -(void) functionB:(NSString*)aVariable; @end In my .m file is: -(void)functionA:(NSString*)aVariable { // do stuff in this function with aVariable } -(void)functionB:(NSString*)aVariable { // do stuff in this function with aVariable }

    Read the article

  • Avoid incompatible pointer warning when dealing with double-indirection

    - by fnawothnig
    Assuming this program: #include <stdio.h> #include <string.h> static void ring_pool_alloc(void **p, size_t n) { static unsigned char pool[256], i = 0; *p = &pool[i]; i += n; } int main(void) { char *str; ring_pool_alloc(&str, 7); strcpy(str, "foobar"); printf("%s\n", str); return 0; } ... is it possible to somehow avoid the GCC warning test.c:12: warning: passing argument 1 of ‘ring_pool_alloc’ from incompatible pointer type test.c:4: note: expected ‘void **’ but argument is of type ‘char **’ ... without casting to (void**) (or simply disabling the compatibility checks)? Because I would very much like to keep compatibility warnings regarding indirection-level...

    Read the article

  • Function defined but not used warning in C

    - by thetna
    I have a number of C source files(both .c and .h files). header files contains a number of functions. Out of those functions, only partially are used in a source .C file.Suppose a.h,b.h are header files and a.c and b.c are .c files. a.h is included in a.c. But only a number of functions those are in a. h are used and rest are not used. After compilation I find following warnings: function XXXX defined but not used. But those XXXX functions which are not used in a.c are used in b.c. So, i can't completely remove those functions too. So , i decided to make a separate file containing only those XXXX functions and included it wherever it is used.Doing this is creating multiple number of header files. Can anybody please suggest me to some effective way to solve this problem.

    Read the article

  • VS2010 (older) installer project - two or more objects have the same target location.

    - by Hamish Grubijan
    This installer project was created back in 2004 and upgraded ever since. There are two offending dll files, which produce a total of 4 errors. I have searched online for this warning message and did not find a permanent fix (I did manage to make it go away once until I have done something like a clean, or built in Release, and then in Debug). I also tried cleaning, and then refreshing the dependencies. The duplicated entries are still in there. I also did not find a good explanation for what this error means. Additional warnings are of this nature: Warning 36 The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box. So, where is this prerequisites box? I want to make both things agree on .Net 4.0, just having a hard time locating both of them.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >