Is there a compiler switch to prevent mistakes in NSLog  statements?

I keep making the same mistake, putting a float argument into an NSLOG statement and using %d to format it which of course returns ZERO.
float val = 123.456;
NSLog (@"my val=%d
", val);
---- the above statement will show 0 in the log, because of the incorrect type!
I realize i should use %0.f to get an integer value, but is there a compiler switch that will check on these parameters and warn you ?

Well, there is a compiler switch to detect mismatches in printf statements, and if you make a macro during testing that converts NSLog to printf then you can get the compiler to catch them!

Similar Messages

  • Still presists in 10.6.8: AppleYukon2: 00000000,00000000 skgehw - cppSkDrvEvent - now preventing C4 low power state due to the switch ignoring pause packets

    My network is constantly dropping out when transfering large files, or if there is a lot of ethernet traffic going on. For example, if I have 5 torrents runnung at the same time.
    My dmesg shows:
    ==> /var/log/kernel.log <==
    Oct 30 11:42:09 mashugana kernel[0]: Kext com.apple.iokit.AppleYukon2 not found for unload request.
    ==> /var/log/kernel.log <==
    Oct 30 11:42:32 mashugana kernel[0]: AppleYukon2: Marvell Yukon Gigabit Adapter 88E8055 Singleport Copper SA
    Oct 30 11:42:32 mashugana kernel[0]: AppleYukon2: RxRingSize <= 1024, TxRingSize 256, RX_MAX_LE 1024, TX_MAX_LE 768, ST_MAX_LE 3328
    Oct 30 11:42:32 mashugana kernel[0]: yukon: Ethernet address XX:XX:XX:XX:XX
    Oct 30 11:42:34 mashugana kernel[0]: Ethernet [AppleYukon2]: Link up on en0, 1-Gigabit, Full-duplex, Symmetric flow-control, Debug [796d,af48,0de1,0200,cde1,7c00]
    ==> /var/log/system.log <==
    Oct 30 11:42:35 mashugana ntpd[42]: bind() fd 25, family 30, port 123, scope 4, addr XXXXX, in6_is_addr_multicast=0 flags=0x11 fails: Can't assign requested address
    Oct 30 11:42:35 mashugana ntpd[42]: unable to create socket on en0 (11) for XXXX#123
    Oct 30 11:42:38 mashugana configd[14]: network configuration changed.
    ==> /var/log/kernel.log <==
    Oct 30 11:42:44 mashugana kernel[0]: AppleYukon2: 00000000,00000000 skgehw - cppSkDrvEvent - SK_DRV_RX_OVERFLOW: rcv fifo overflow
    Oct 30 11:42:44 mashugana kernel[0]: AppleYukon2: 00000000,00000000 skgehw - cppSkDrvEvent - now preventing C4 low power state due to the switch ignoring pause packets
    The only answer is to hard reboot the machine as everything hangs. Even the shell in Terminal.app is stuck which is a pitty as I feel certain that kextunload/kextload AppleYukon2.kext would free the problem but I cant even get to it.
    Getting real miffed with 10.6.8 as since I upgraded I have a whole host of problems with it. I cant even plug my ipod in without itunes core dumping.

    BTW: what does
    now preventing C4 low power state due to the switch ignoring pause packets
    mean? What are the consequences?
    tia.

  • I keep getting Configuration Error: 6 when I try to open my Adobe CS5.1 on my Macbook Pro with 10.6.8 operating system. I have tried to restart in safe mode and un/re-installing. What is there I can do to prevent this?

    I keep getting Configuration Error: 6 when I try to open my Adobe CS5.1 on my Macbook Pro with 10.6.8 operating system. I have tried to restart in safe mode and un/re-installing. What is there I can do to prevent this?

    Error 2, 4 (or -4), 6, 1000, 9006
    Follow Troubleshooting security software. Often, uninstalling third-party security software will resolve these errors.
    There may be third-party software that modifies your default packet size in Windows by inserting a TcpWindowSize entry into your registry. Your default packet size being set incorrectly can cause these errors. Contact the manufacturer of the software that installed the packet size modification for assistance or follow this article by Microsoft: How to reset Internet Protocol (TCP/IP).
    Verify that access to ports 80 and 443 are allowed on your network.
    Verify that communication to albert.apple.com or photos.apple.com is not blocked by a firewall, or other Internet security setting.
    Discard the .ipsw file, open iTunes and attempt to download the update again. See the steps underAdvanced Steps > Rename, move, or delete the iOS software file (.ipsw) below for file locations.
    Restore your device while connected to a different network.
    Restore using a different computer.

  • Is there an output switch at the analog front end of PXI-6723 and PXI-6713?

    I was reading the analaog output user manual and i could not find this. Is there any output switch just before the analog output of each channel for PXI-6723 and PXI-6713? I am would like to have total isolation between when these output are not needed. If yes, is there any specification to refer to?
    Thanks.

    Hello Chris,
         I would recommend having a look at the examples in the LabVIEW
    example finder to start with. In particular i would look at 'Cont Gen
    Wfm-Ext Clk.vi' This is a basic example that allows you to output a
    waveform through the card and source an external clock source to do
    this. I would recommend exporting the sample clock that you wish to use
    from the 4462 on one of the RTSI lines and then setting this as the
    sample clock source for the Analog output card.
    Another good example to look at is the 'Cont Gen Voltage Wfm-Int Clk
    non regeneration.vi' This does not regenerate the same waveform in the
    buffer but instead creates a new waveform to output after the previous
    one has been written to the buffer.
    It should be noted that there may be some gliltching if you are
    updating the waveform. This is because the buffer will already have a
    waveform in there to output before you input the new one so a new
    frequency may not have an exact number periods that fit into the
    pre-defined buffer. If you are looking to generate dynamic waveforms
    then the best option for the best results would be one of our arbitrary
    waveform generators here.
    Good Luck,
    LeeM
    NIUK

  • I have a Sony AC-U50AD charger can I use it on my ipod touch and ipad mini - there is a switch for "ipod"

    I have a Sony AC-U50AD charger can I use it on my ipod touch and ipad mini - there is a switch for "ipod" - I've had the adapter for several years and I think it's ok for my ipod touch but since it pre-dates both of these products I want to try and make sure it's ok to use with them before I do use it. Thanks.

    If iTunes does not see your iPod then your only hope is a data recovery company. Not cheap.
    However, you may be able to get some photos by:
    Photos
    - If they are in an iPod backup then restore another iPOd, iPhone or iPad from that backup. See the restore topic of:
    iOS: How to back up
    - If you used PhotoStream then try getting them from your PhotoStream. See that topic of:
    iOS: Importing personal photos and videos from iOS devices to your computer
    - If they are in the iTunes backup then get them from the backup by:
    Recover iPhone, iPad or iPod photos from backups with Picturescue
    How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html
    iPod recovery software to restore lost music files      

  • Why does a form automatically close? Is there a way I can prevent this from happening?

    Why does a form automatically close? Is there a way I can prevent this from happening and keep it 'Open'?

    The form will close automatically when you do changes that can affect the form fillers. Sorry there is nothing you can do beside explicitly open the form after your changes.
    Gen

  • DPF-0009 There were compilation errors

    I am trying to use the Data Profiling tool incorporated in Warehouse Builder Rel 2 10.2.0.1
    I am getting the above error "DPF-0009 There were compilation errors"
    I traced back the problem to the fact that the user OWB_OWNER_PRF's password was changed. However, I did go into the Connection explorerer and update the pasword of the corresponding location. However, that has not helped.
    When I run the profile it starts the validation process and the progress bar stops with the following message -
    "OWB_PRF_OWNER_LOCATION (Create) - 1"
    At that point the progress bar stops and I get this error.
    I would really appreciate it if some one can give me some points about how this can be fixed ?
    Thank you
    Manav

    Hi Manav
    Are you profiling using a repository user (rather than owner)? If so, this may be bug 5338439.
    If so there are a couple of workarounds:
    1) Go into the control center, register all locations and then go back and perform the data profile.
    or
    2) Log in as the repository owner, go into preferences and select both persist passwords and share location passwords.
    Cheers
    David

  • I just switched to Lion from SL, and am regretting it deeply, is there anyway to switch back to SL but still keep lion on your hard drive until you want it again?

    I just switched to Lion from SL, and am regretting it deeply, is there anyway to switch back to SL but still keep lion on your hard drive until you want it again?
    I hate to have paid for it and have it go away. Help please!

    Start by creating a second partition on your hard drive:
    To resize the drive do the following:
    1. Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    After the main menu appears select Disk Utility and click on the Continue button. Select the hard drive's main entry then click on the Partition tab in the DU main window.
    2. You should see the graphical sizing window showing the existing partitions. A portion may appear as a blue rectangle representing the used space on a partition.
    3. In the lower right corner of the sizing rectangle for each partition is a resizing gadget. Select it with the mouse and move the bottom of the rectangle upwards until you have reduced the existing partition enough to create the desired new volume's size. The space below the resized partition will appear gray. Click on the Apply button and wait until the process has completed.  (Note: You can only make a partition smaller in order to create new free space.)
    4. Click on the [+] button below the sizing window to add a new partition in the gray space you freed up. Give the new volume a name, if you wish, then click on the Apply button. Wait until the process has completed.
    You should now have a new volume on the drive.
    It would be wise to have a backup of your current system as resizing is not necessarily free of risk for data loss.  Your drive must have sufficient contiguous free space for this process to work.
    Install Snow Leopard on the new partition:
    Boot from your Snow Leopard Installer disc. Proceed with reinstalling OS X. Be sure to choose your new partition as the target destination.
    Download and install the Mac OS X 10.6.8 Update Combo v1.1 update. Any additional updates can be installed using Software Update.

  • I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.  How can I rectify this?

    I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.
    How can I rectify this?

    I have previewed my book but after cliking BUY BOOK it compiles it OK but then it always states an error after of during uploading it to the store.
    How can I rectify this?

  • There is an unclosed comment block in the SQL statement. Ensure that there are balanced "/*" and "*/" comment markers in the SQL statement.

    I get this error - when I try a Multi-line comment entry - by using the /* and */
    "There is an unclosed comment block in the SQL statement. Ensure that there are balanced "/*" and "*/" comment
    markers in the SQL statement."
    Even though I am entering both the /* and the */.
    I tried it many way - in the same line, in different lines etc..
    like 
    /* Select xxx from xxx */
    or
    Select xxx from xxx
    or 
    /* Select xx from xx
    Please help anyone..! ;=(

    But When I do a Help/About I see that it is 
    the SSMSE's Help About screen says "SQL Server 2005"
    However I downloaded and installed SQL Server 2014 last night and was entering queries..
    Most Select Queries work fine..
    the -- comment line works fine..then I stumbled on the /*  - */ does not work.
    Thanks.
    Well, you have two different version of SQL Server installed on your machine. Please connect again from SSMS to the SQL Server 2014.
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • HT4623 I am unable to switch on my IPad as it states that 'iPad is disabled'.  How do i fix this problem when I have no access to the iPad?  Any help or advice will be gratefully received.

    I am unable to switch on my IPad as it states that 'iPad is disabled'.  How do I fix this problem when I have no access to the iPad?  Any help or advice will be gratefully received.

    Forgotten Passcode or device disabled after entering wrong passcode

  • I have repeatedly installed and uninstalled Microsoft Silverlight, I have followed every thing out there and uninstalled from various folders.  It still states the program is there and it won't run.  This is also happening with my coupon printer that word

    I have repeatedly installed and uninstalled Microsoft Silverlight, I have followed every thing out there and uninstalled from various folders.  It still states the program is there and it won't run.  This is also happening with my coupon printer that word

    Copied from a page that helped me:
    I followed someone else's advice and found all the silverlight files in "INVISIBLE FILES".
    In the Finder, choose File > Find or press Command (⌘)-F.
    From the far-left pop-up menu (labeled “Kind”), choose Other.
    In the list of search attributes, select the “File invisible” checkbox, and then click OK.
    In the related menu, choose Invisible Items.
    once loaded go to folder Private
    then to folder VAR
    then folder db
    then folder Receipts
    scroll to any com.microsoft.silverlight item and delete. there are a bunch of them.
    close, restart and install silverlight.

  • How come there isn't a comma between the city and state when I go to make an envelope with an address book contact?

    How come there isn't a comma between the city and state when I go to make an envelope with an address book contact?

    On an envelope, there's not supposed to be. The US Postal Serveice prefers no punctuation, which can interfere with machine sorters. USPS Address Format

  • Why there is implicit commit before and after executing DDL Statements

    Hi Guys,
    Please let me know why there is implicit commit before and after executing DDL Statements ?
    Regards,
    sushmita

    Helyos wrote:
    This is because Oracle has design it like this.Come on Helyos, that's a bit of a weak answer. :)
    The reason is that it makes no sense to update the structure of the database whilst there is outstanding data updates that have not been committed.
    Imagine having a column that is VARCHAR2(50) that currently only has data that is up to 20 characters in size.
    Someone (person A) decides that it would make sense to alter the table and reduce the size of the column to varchar2(20) instead.
    Before they do that, someone else (person B) has inserted data that is 30 characters in size, but not yet committed it.
    As far as person B is concerned that insert statement has been successful as they received no error, and they are continuing on with their process until they reach a suitable point to commit.
    Person A then attempts to alter the database to make it varchar2(20).
    If the database allowed that to happen then the column would be varchar2(20) and the uncommitted data would no longer fit, even though the insert was successful. When is Person B going to find out about this? It would be wrong to tell them when they try and commit, because all their transactions were successful, so why should a commit fail.
    In this case, because it's two different people, then the database will recognise there is uncommitted transactions on that table and not let person B alter it.
    If it was just one person doing both things in the same session, then the data would be automatically committed, the alter statement executed and the person informed that they can't alter the database because there is (now) data exceeding the size they want to set it to.
    It makes perfect sense to have the database in a data consistent state before any alterations are made to it, hence why a commit is issued beforehand.
    Here's something I wrote the other day on the subject...
    DDL's issue a commit before carrying out the actual action
    As long as the DDL is syntactically ok (i.e. the parser is happy with it) then the commit is issued, even if the actual DDL cannot be executed for another reason.
    Example...
    We have a table with some data in it...
    SQL> create table xtest as select rownum rn from dual;
    Table created.
    SQL> select * from xtest;
            RN
             1We then delete the data but don't commit (demonstrated by the fact we can roll it back)
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selected
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
            RN
             1
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selectedSo now our data is deleted, but not committed, what if we issue a DDL that is syntactically incorrect...
    SQL> alter tab xtest blah;
    alter tab xtest blah
    ERROR at line 1:
    ORA-00940: invalid ALTER command
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
            RN
             1... the data can still be rolled back. This is because the parser was not happy with the syntax of the DDL statement.
    So let's delete the data again, without committing it, and issue a DDL that is syntactically correct, but cannot execute for another reason (i.e. the database object it refers to doesn't exist)...
    SQL> delete from xtest;
    1 row deleted.
    SQL> select * from xtest;
    no rows selected
    SQL> truncate table bob;
    truncate table bob
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
    no rows selectedSo, there we have it. Just because the statement was syntactically correct, the deletion of the data was committed, even though the DDL couldn't be performed.
    This makes sense really, because if we are planning on altering the definition of the database where the data is stored, it can only really take place if the database is in a state where the data is where it should be rather than being in limbo. For example, imagine the confusion if you updated some data on a column and then altered that columns datatype to be a different size e.g. reducing a varchar2 column from 50 character down to 20 characters. If you had data that you'd just updated to larger than 20 characters whereas previously there wasn't, then the alter table command would not know about it, would alter the column size and then the data wouldn't be valid to fit whereas the update statement at the time didn't fail.
    Example...
    We have a table that only allows 20 characters in a column. If we try and insert more into that column we get an error for our insert statement as expected...
    SQL> create table xtest (x varchar2(20));
    Table created.
    SQL> insert into xtest values ('012345678901234567890123456789');
    insert into xtest values ('012345678901234567890123456789')
    ERROR at line 1:
    ORA-12899: value too large for column "SCOTT"."XTEST"."X" (actual: 30, maximum: 20)Now if our table allowed more characters our insert statement is successful. As far as our "application" goes we believe, nay, we have been told by the database, we have successfully inserted our data...
    SQL> alter table xtest modify (x varchar2(50));
    Table altered.
    SQL> insert into xtest values ('012345678901234567890123456789');
    1 row created.Now if we tried to alter our database column back to 20 characters and it didn't automatically commit the data beforehand then it would be happy to alter the column, but then when the data was committed it wouldn't fit. However the database has already told us that the data was inserted, so it can't go back on that now.
    Instead we can see that the data is committed first because the alter command returns an error telling us that the data in the table is too big, and also we cannot rollback the insert after the attempted alter statement...
    SQL> alter table xtest modify (x varchar2(20));
    alter table xtest modify (x varchar2(20))
    ERROR at line 1:
    ORA-01441: cannot decrease column length because some value is too big
    SQL> rollback;
    Rollback complete.
    SQL> select * from xtest;
    X
    012345678901234567890123456789
    SQL>Obviously, because a commit statement is for the existing session, if we had tried to alter the table column from another session we would have got
    SQL> alter table xtest modify (x varchar2(20));
    alter table xtest modify (x varchar2(20))
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified
    SQL>... which is basically saying that we can't alter the table because someone else is using it and they haven't committed their data yet.
    Once the other session has committed the data we get the expected error...
    ORA-01441: cannot decrease column length because some value is too bigHope that explains it

  • Is there an obvious way to prevent an FPGA multiply from using DSPs?

    In FPGA coding a High Throughput Multiply function will take advantage of any available DSPs on your FPGA. This is great, unless you have more multipliers than available DSPs. My FPGA code is currently failing to fit, and although it's using just 50% of the Registers/Slices, it's trying to use more DSPs than are available (My Virtex 5 chip has 64 DSPs).
    In the help I'm pretty sure it says the compiler will revert to using slices for multiplications in the absence of sufficient DSPs, but my experience is otherwise.
    If I convert just one of the High Throughput Multiply functions to a standard LabVIEW Math multiply primitive I receive timing errors from the compiler (even though there are minimal timing constraints in my code), and it therefore still fails to compile.
    So my question is: Is there a way to prevent a Multiply function in LabVIEW FPGA from using DSPs?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    Dragis wrote:
    Unfortunately, this is a bug/feature of the Xilinx tools. Once the tools have decided to choose DSP blocks for the multipliers, it will only use them and not place any in logic. There is a way to disable automatic usage of DSP blocks, you'll have to work with NI customer support to make that change. If you use this option, you'll have to manually drop the High Throughput Multiplier everywhere you want a DSP48 to be used.
    I've gone through Technical Support with this issue once before about a year ago and there was no mention of a 'solution', just the unhelpful suggestion to "use fewer multipliers". I'll raise another support case and link to this thread, maybe they'll need to speak with you directly to understand what this option is.
    I'm perfectly happy, in fact I'd prefer, to be able to specifically select where a DSP is and isn't used for a multiplication. If reasonable, I'd suggest this option to disable automatic usage of DSPs be made public (either through the knowledgebase, or as an actual feature in the FPGA toolkit perhaps).
    Thanks Dragis.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

Maybe you are looking for

  • Amount of max possible simultaneous INSERTs depend on what ??

    Hi all, can somebody comment on following statement , whether its is absolutely true, only a part of the truth or completely wrong : "The maximum possible amount of transactions that are simultaneously performing inserts into an Oracle- table is MAIN

  • Data Model damaged, Cannot connect to Access 2013 from within Excel 2013

    Hello, Recently I am not able to use PowerPivot for Excel 2013 and I cannot connect to my Access 2013 database tables from within Excel 2013. Whenever I try to click on a slicer in my Excel worksheet, it gives me the following error: "Excel was unabl

  • Oracle DEVELOPER with DBA responsibility (50/50)

    Hi all, I am very interested in sharing your opinion about such kind of job, which probably some of you already have. This is a middle size company looking for combination DBA/Developer with minimum 10 years Oracle experience, utilizing the newer too

  • Error configuring the repository using Repository Assistant.

    Hi, I have a SYSDBA access to a oracle 9i instance and i tried to configure the OWB Repository through Repository Assistant. I am getting the following error. How can i rectify this error. INS0037 - The initialization parameter job_queue_processes of

  • Lsmw transport error

    Hi All, LSMW is working absolutely fine in dev, but after exporting and importing it to Q, LSMW is giving the error when I run the convert data, but it still works fine till display read data in Q. I am getting this error :SAP_LSMW_CONV_00000001 Than