Search Results

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

Page 15/234 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Why is the compiler caching my "random" and NULLED variables?

    - by alex gray
    I am confounded by the fact that even using different programs (on the same machine) to run /compile, and after nilling the vaues (before and after) the function.. that NO MATTER WHAT.. I'll keep getting the SAME "random" numbers… each and every time I run it. I swear this is NOT how it's supposed to work.. I'm going to illustrate as simply as is possible… #import <Foundation/Foundation.h> int main(int argc, char *argv[]) { int rPrimitive = 0; rPrimitive = 1 + rand() % 50; NSNumber *rObject = nil; rObject = [NSNumber numberWithInt:rand() % 10]; NSLog(@"%i %@", rPrimitive, rObject); rPrimitive = 0; rObject = nil; NSLog(@"%i %@", rPrimitive, rObject); return 0; } Run it in TextMate: i686-apple-darwin11-llvm-gcc-4.2 8 9 0 (null) Run it in CodeRunner: i686-apple-darwin11-llvm-gcc-4.2 8 9 0 (null) Run it a million times, if you'd like. You can gues what it will always be. Why does this happen? Why oh why is this "how it is"?

    Read the article

  • Why is writing a compiler in a functional language so efficient and easier?

    - by wvd
    Hello all, I've been thinking of this question very long, but really couldn't find the answer on Google as well a similar question on Stackoverflow. If there is a duplicate, I'm sorry for that. A lot of people seem to say that writing compilers and other language tools in functional languages such as OCaml and Haskell is much more efficient and easier then writing them in imperative languages. Is this true? And if so -- why is so efficient and easy to write them in functional languages instead of in an imperative language, like C? Also -- isn't a language tool in a functional language slower then in some low-level language like C? Thanks in advance, William v. Doorn

    Read the article

  • Why does the Java compiler complain about a local variable not having been initialized here?

    - by pele
    int a = 1, b; if(a > 0) b = 1; if(a <= 0) b = 2; System.out.println(b); If I run this, I receive: Exception in thread "main" java.lang.Error: Unresolved compilation problem: The local variable b may not have been initialized at Broom.main(Broom.java:9) I know that the local variables are not initialized and is your duty to do this, but in this case, the first if doesn't initialize the variable?

    Read the article

  • inconsistency between Sun JRE javac and Eclipse java compiler?

    - by Jason S
    This confuses me. The following compiles fine under Eclipse. package com.example.gotchas; public class GenericHelper1 { static <T> T fail() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } /** * just calls fail() * @return something maybe */ public boolean argh() { return fail(); } public static void main(String[] args) { // TODO Auto-generated method stub } } But if I try to do a clean build with ant, or at the command line with javac, I get this: src\com\example\gotchas\GenericHelper1.java:14: type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds boolean,java.lang.Object public boolean argh() { return fail(); } ^ 1 error what gives, and how do I fix it?

    Read the article

  • Why is writing a compiler in a functional language easier?

    - by wvd
    Hello all, I've been thinking of this question very long, but really couldn't find the answer on Google as well a similar question on Stackoverflow. If there is a duplicate, I'm sorry for that. A lot of people seem to say that writing compilers and other language tools in functional languages such as OCaml and Haskell is much more efficient and easier then writing them in imperative languages. Is this true? And if so -- why is it so efficient and easy to write them in functional languages instead of in an imperative language, like C? Also -- isn't a language tool in a functional language slower then in some low-level language like C? Thanks in advance, William v. Doorn

    Read the article

  • OS Development. Only Few Particular Questions

    - by Total Anime Immersion
    I am new to this site as a member but have consulted its answers quite a lot of times. Besides my questions regarding OS Development hasn't been answered in any forum. In OS Dev. we make a bootloader. The org point is 7C00H. Why so? Why not 0000h? What are the last two signatures in the bootloader used for? People on every forum have answered that it is important for the system to recognize it as a bootable media. But I want a specific answer. What do each of those signatures do. I have the basic concept of a kernel. Point is.. it relates to different files required in a system. It sort of binds up everything that is individually developed. Now the thing is that that I have floating ideas in my mind regarding different aspects like keyboard, mouse, etc.. how do I put them all together? Which should I start with first? If possible please provide a step by step procedure of the startups of the kernel. Suppose I have developed my language entirely in C and Assembly. Now questions is will exe files work on my system.. if it doesn't then I have to create my own files and publish them. Which is a bad idea.. next step would be for me to go for a compiler for a language which I have designed myself. Now the point is.. How do I implement the compiler into my OS? After all this my final question is that.. How do you go about multitasking and multithreading? and I don't want to use int 21h as its dos specific.. how do I go about making files, renaming them, etc. and all assembly books teach 16 but programming.. how do i go about doing 32 bit or 64 bit with the knowledge I have.. if the basics and instructions are the same.. I don't mind.. but how do i go about otherwise? Don't tell me to give up the idea because I WON'T. And don't tell me it's too complex because I have a sharp knowledge of working of a system, C, Java, Assembly, C++ and python, C#, visual basic.. and not just basics but full fledged api developments.. but I really want to go deep into the systems part.. so I want professional help.. And I have gone through many OS project files but I want help particularly from this site as there are people with knowledge depth who can guide me the right way. And please don't suggest any books above 20$ and they should be available on flipkart as amazon charges massively for shipping and I prefer free shipping from flipkart.

    Read the article

  • Objective C: Class Extensions and Protocol Conformation Warnings

    - by Ben Reeves
    I have a large class, which I have divided into several different class extension files for readability. @protocol MyProtocol @required -(void)required; @end @interface MyClass : NSObject <MyProtocol> @end @interface MyClass (RequiredExtension) -(void)required; @end Is there a better way to do this, without the compiler warning? warning: class 'MyClass' does not fully implement the 'MyProtocol' protocol

    Read the article

  • Should static analysis warnings fail the CI build?

    - by Cara
    Our team is investigating various options for static analysis in our project, and have mixed opinions about whether we want our Continuous Integration build to fail because of warnings from static analysis. The argument against failing the build is that there are often exceptions to the rules, and attempting to work around them just to make the build succeed reduces productivity. A better approach would be to generate reports with the build, and regularly dedicate developer time to addressing the reported issues. The counter-argument is that it is easy for the technical debt to build up if the bugs are not addressed immediately. Also, if the build fails when a potential bug is introduced, the amount of time required to fix it is reduced. What are your thoughts?

    Read the article

  • Infinite gtk warnings when I right click on the icon --CLOSED

    - by Runner
    From this tuto: #include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main(); return 0; } I run the executable and right click on the icon,then infinite warnings(the same) reported: GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member. Anyone knows how to fix this warning? UPDATE This problem also exists with gtk-demo , is it a gtk bug? Can someone verify that? Platform: windows XP UPDATE AGAIN This is indeed a gtk bug,which is un-fixable.

    Read the article

  • Errors/Warnings/Debug Info no longer appears in Debug Console

    - by Alex L
    Hi Guys: This one is driving me crazy. When I run my App and open the Debug Console there is nothing there! Nope, not even the output from my NSLog statements. Before I would see a bunch of debug information starting with [Session Started ...] and ending with 'Terminating in response to SpringBoard's termination'. The Status Bar at the bottom of the Console says my App was successfully launched. Even Errors and Warnings from my code no longer appear. How do I get this to show up again? Any help would be greatly appreciated.

    Read the article

  • Infinite gtk warnings when I right click on the icon

    - by Runner
    From this tuto: #include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main(); return 0; } I run the executable and right click on the icon,then infinite warnings(the same) reported: GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member. Anyone knows how to fix this warning?

    Read the article

  • how to install g77 on ubuntu 12.04

    - by ubuntu-beginner
    I want a workin g77 compiler on my Ubuntu 12.04 64 bit laptop. so did the following: 1. I change the sources.list by adding the following lines: deb http...hu.archive.ubuntu.com/ubuntu/ hardy universe deb-src ..//hu.archive.ubuntu.com/ubuntu/ hardy universe deb http:...hu.archive.ubuntu.com/ubuntu/ hardy-updates universe deb-src ..//hu.archive.ubuntu.com/ubuntu/ hardy-updates universe then I on a terminal i did the following: sudo apt-get update sudo apt-get install g77 Things looked very nice then. But when I tried to compile with g77 on my Fortran77 program. I got the following errors: /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status Why doesn't the g77 work properly. Many people need g77 why cannot Ubuntu offer a workable g77 ? Please Help me ! Thanks from a ubuntu-beginner

    Read the article

  • Converting ANTLR AST to Java bytecode using ASM

    - by Nick
    I am currently trying to write my own compiler, targeting the JVM. I have completed the parsing step using Java classes generated by ANTLR, and have an AST of the source code to work from (An ANTLR "CommonTree", specifically). I am using ASM to simplify the generating of the bytecode. Could anyone give a broad overview of how to convert this AST to bytecode? My current strategy is to explore down the tree, generating different code depending on the current node (using "Tree.getType()"). The problem is that I can only recognise tokens from my lexer this way, rather than more complex patterns from the parser. Is there something I am missing, or am I simply approaching this wrong? Thanks in advance :)

    Read the article

  • Why does Facebook convert PHP code to C++?

    - by user72245
    I read that Facebook started out in PHP, and then to gain speed, they now compile PHP as C++ code. If that's the case why don't they: Just program in c++? Surely there must be SOME errors/bugs when hitting a magic compiler button that ports PHP to c++ code , right? If this impressive converter works so nicely, why stick to PHP at all? Why not use something like Ruby or Python? Note -- I picked these two at random, but mostly because nearly everyone says coding in those languages is a "joy". So why not develop in a super great language and then hit the magic c++ compile button?

    Read the article

  • How compilers know about other classes and their properties?

    - by OnResolve
    I'm writing my first programming language that is object orientated and so far so good with create a single 'class'. But, let's say I want to have to classes, say ClassA and ClassB. Provided these two have nothing to do with each other then all is good. However, say ClassA creates a ClassB--this poses 2 related questions: -How would the compiler know when compiling ClassA that ClassB even exists, and, if it does, how does it know it's properties? My thoughts thus far had been: instead of compiling each class at a time (i.e scan, parse and generate code) each "file (not really file, per se, but a "class") do I need to scan + parse each first, then generate code for all?

    Read the article

  • How can I get MySQL 5.5 to log warnings to one of the log files?

    - by Wodin
    I have found various things that say that you can log warnings to the MySQL error log, but I have not been able to actually make it happen. I do have the error log working, and MySQL prints stuff to it on startup and shutdown and occasionally at other times, but if I e.g. SELECT CAST('123' AS DATE); and then SHOW WARNINGS; I can see the warning, but it does not show up in any logs. I've also tried enabling the general log and the slow query log, but these don't show the warnings either. I've tried with log_warnings = 1 and log_warnings = 2, but still no warnings are logged. What am I doing wrong? mysql> show variables like '%error%'; +--------------------+--------------------------+ | Variable_name | Value | +--------------------+--------------------------+ | error_count | 0 | | log_error | /var/log/mysql/mysql.err | | max_connect_errors | 10 | | max_error_count | 1024 | | slave_skip_errors | OFF | +--------------------+--------------------------+ mysql> show variables like '%warn%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_warnings | 1 | | sql_warnings | OFF | | warning_count | 0 | +---------------+-------+ 3 rows in set (0.06 sec) mysql> show variables like '%log%'; +-----------------------------------------+-------------------------------+ | Variable_name | Value | +-----------------------------------------+-------------------------------+ ... | general_log | ON | | general_log_file | /var/log/mysql/general.log | ... | log | ON | ... | log_error | /var/log/mysql/mysql.err | | log_output | FILE | | log_queries_not_using_indexes | ON | ... | log_warnings | 1 | ... | slow_query_log | ON | | slow_query_log_file | /var/log/mysql/mysql-slow.log | ... +-----------------------------------------+-------------------------------+ Edit: mysql> show global status like 'Aborted%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | Aborted_clients | 24 | | Aborted_connects | 15 | +------------------+-------+ 2 rows in set (0.08 sec) Edit: Clarification: I do get [Warning] Aborted connection 1 to db... and [Warning] Access denied for user... messages logged, but not the warnings that you can see via SHOW WARNINGS after e.g. inserting something or running LOAD DATA INFILE... which is what I'm looking for.

    Read the article

  • Optimising RSS parsing on App Engine to avoid high CPU warnings

    - by Danny Tuppeny
    I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise my code. Currently, I use minidom (since it's already there on App Engine), but I suspect it's not very efficient! Here's the code: dom = minidom.parseString(urlfetch.fetch(url).content) if dom: items = [] for node in dom.getElementsByTagName('item'): item = RssItem( key_name = self.getText(node.getElementsByTagName('guid')[0].childNodes), title = self.getText(node.getElementsByTagName('title')[0].childNodes), description = self.getText(node.getElementsByTagName('description')[0].childNodes), modified = datetime.now(), link = self.getText(node.getElementsByTagName('link')[0].childNodes), categories = [self.getText(category.childNodes) for category in node.getElementsByTagName('category')] ); items.append(item); db.put(items); def getText(self, nodelist): rc = '' for node in nodelist: if node.nodeType == node.TEXT_NODE: rc = rc + node.data return rc There isn't much going on, but the scripts often take 2-6 seconds CPU time, which seems a bit excessive for looping through 20ish items and reading a few attributes. What can I do to make this faster? Is there anything particularly bad in the above code, or should I change to another way of parsing? Are there are any libraries (that work on App Engine) that would be better, or would I be better parsing the RSS myself?

    Read the article

  • Audio in xCode4.x is producing console warnings

    - by David DelMonte
    While the app works, I am seeing pages of console log warnings when I'm running my app on the simulator. Even Apple's "LoadPresetDemo" sample app produces the same warning messages. I don't want to reproduce them all here (about 500 lines), but here are few. I would appreciate any insight into what's going on... Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.098 appname[4175:16c03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security ... Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.245 appname[4175:16c03] Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x7b6b0780 (bundle, not loaded) 2011-11-30 17:43:00.255 appname[4175:16c03] Error loading /Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio: dlopen(/Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio, 262): Symbol not found: ___CFObjCIsCollectable

    Read the article

  • Clearing "may not respond" warnings for UIView and UIViewController

    - by user284681
    In an iPad app, I'm using a custom subclass of UIView with UIViewController. Here's the view header: @interface pdfView : UIView { CGPDFDocumentRef doc; } -(void)setDoc:(CGPDFDocumentRef)newDoc; @end And here's the controller header: @interface iPadPDFTestViewController : UIViewController { CGPDFDocumentRef doc; } - (void)loadPDF; @end Part of the controller implementation: - (void)viewDidLoad { [super viewDidLoad]; [self loadPDF]; [self.view setDoc:doc]; } In Interface Builder, I've set the view object to use the class pdfView. At compilation, [self.view setDoc:doc]; gives the warning "'UIView' may not respond to '--setDoc'." I'm guessing that this warning appears because the compiler thinks it's looking at UIView (which does not implement the setDoc method) instead of pdfView. But why does it think that? And how can I tell it what class it's really looking at, so as to clear the warning?

    Read the article

  • Core Data produces Analyzer warnings

    - by RickiG
    Hi I am doing the final touch ups on an app and I am getting rid of every compiler/analyzer warning. I have a bunch of Class methods that wrap my apps access to Core Data entities. This is "provoking" the analyzer. + (CDProductEntity*) newProductEntity { return (CDProductEntity*)[NSEntityDescription insertNewObjectForEntityForName:@"CDProductEntity" inManagedObjectContext:[self context]]; } Which results in an Analyzer warning: Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected In the method that calls the above Class Method I have this: CDProductEntity *newEntity = [self newProductEntity]; Which results in an Analyzer warning: Method returns an Objective-C object with a +1 retain count (owning reference) Explicitly releasing or autoreleasing a Core Data entity is usually very very bad, but is that what it is asking me to do here? First it tells me it has a +0 retain count and that is bad, then it tells me it has a +1 which is also bad. What can I do to ensure that I am either dealing with a Analyzer hiccup or that I release correctly? Thanks in advance

    Read the article

  • "'Objects' may not respond to 'functions'" warnings.

    - by Andrew
    Hello all, for the last couple of weeks I've finally gotten into Obj-C from regular C and have started my first app. I've watched tutorials and read through a book along with a lot of webpages, but I know I've only just begun. Anyway, for most of the night and this morning, I've been trying to get this code to work, and now that it will compile, I have a few warnings. I've searched and found similar problems with solutions, but still no dice. What I'm trying to do is put an array made from a txt document into the popup list in a combo box. AwesomeBoxList.h: #import <Cocoa/Cocoa.h> @interface AwesomeBoxList : NSObject { IBOutlet NSComboBox *ComboBoz; } -(NSArray *) getStringzFromTxtz; - (void) awesomeBoxList; @end AwesomeBoxList.m: #import "AwesomeBoxList.h" @implementation AwesomeBoxList -(NSArray *)getStringzFromTxtz { ... return combind; } - (void) awesomeBoxList { [ComboBoz setUsesDataSource:YES]; [ComboBoz setDataSource: [ComboBoz getStringzFromTxtz]: //'NSComboBox' may not respond to 'getStringzFromTxtz' [ComboBoz comboBox:(NSComboBox *)ComboBoz objectValueForItemAtIndex: [ComboBoz numberOfItemsInComboBox:(NSComboBox *)ComboBoz]]]; /*'NSComboBox' may not respond to '-numberOfItemsInComboBox:' 'NSComboBox' may not respond to '-comboBox:objectValueForItemAtIndex:' 'NSComboBox' may not respond to '-setDataSource:' */ } @end So, with all of these errors and my still shallow knowledge of Obj-C, I must be making some sort of n00b mistake. Thanks for the help.

    Read the article

  • LNK4221 and LNK4006 Warnings!

    - by user295030
    Hi, I basically making a static library of my own. I have taken my code which works and now put it into a static library for another program to use. In my library I am using another static library which I don't want the people who will be using my API to know. Since, I want to hide that information from them I can't tell them to install the other static library. Anyway, I used the command line Lib.exe to extract and create a smaller lib file of just the obj's I used. However, I get a bunch of "LNK4006 :second definition ignored" linker warnings for each obj I use followed by "LNK4221 no public symbols found;archive member will be inaccessible". I am doing this work in vs2008 and I am not sure what I am doing wrong. I am using the #pragma comment line in my .cpp file I have also modified the librarian to add my smaller .lib along with its location. my code simply makes calls to a couple functions which it should be able to get from those Obj file in the smaller lib. All my functions are implemented in .cpp file and my header just have the includes of the third party header files and come standard c++ header files. nothing fancy. I have actually no function definitions in there atm. I was going to put the API definition in there and implement that in the .cpp for this static lib that i was going to make. However, I just wanted to build my code before I added more to it. s Any help would be appreciated. is this a vs2008 configuration issue? or a program issue I am not sure. thanks for the help!

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >