Reset file name and line number in preprocessor

We are using Sun Studio 12u1 on Solaris x86 10u9.
For one of our large projects our make file copies many C++ source files into one large allsource.cpp file. This results in significantly faster compilation and better inter-procedural optimizations.
Unfortunately, when the compiler generates warning or error messages they refer to allsource.cpp. Also when it comes time to debug, dbx is looking for debugging information for the original source file instead of looking for allsource.o.
On Windows (MSVC), we use the #line directive to reset the line number and filename so that the error messages point to the correct line and number, and so that the debugger knows that the debugging information for myfile.cpp is actually in allsource.o.
Does the Sun compiler have anything similar to the #line directive?

To reset the preprocessor to the start of a new file:
#1 "filename"
where filename is the name or complete path name of the file.
To change the line number within the current file:
#N
or
#line N
where N is an integer
Example:
% cat z.cc
struct S { X x; };
#1 "/foo/bar.h"
Int I;
#500
Float F;
#line 1000
Double D;
88% CC -c z.cc
"z.cc", line 1: Error: Type name expected instead of "X".
"/foo/bar.h", line 1: Error: Int is not defined.
"/foo/bar.h", line 500: Error: Float is not defined.
"/foo/bar.h", line 1000: Error: Double is not defined.
4 Error(s) detected.BTW, you might get a similar improvement in compile time by using precompiled headers.
The -xipo option provide inter-procedural optimization across compilation units. Refer to the C++ Users Guide for details.
We seem to have a bug in the Forum software. My original source code and the compiler output have double quotes ("...") but they show as single quotes in the code brackets.
Edited by: clamage45 on Apr 13, 2010 1:13 PM

Similar Messages

  • How to find proc/func name from package name and line number?

    Hi,
    We are using the pl/sql call stack dump (dbms_utility.format_call_stack) for some debugging purposes. But in the case of a package body execution, the dump does not return the name of the procedure/function that is being executed, but only the name of the package and the line number being executed. So, we have a requirement wherein we need to extract the type and name of a package subunit from the package name and line number.
    e.g.
    From the information package 'A', line number 739
    we should be able to deduce that line 739 is a part of *'function A.f'*
    Does the oracle database provide any native mechanism (PL/SQL packages or otherwise) to support such functionality? If it does not, how can we achieve the desired result?
    Thanks in advance,
    Shashank

    The approach we are currently planning to take up is this :
    1. Write PL/SQL code to parse the entire source (user_source) and build a database table with a structure like this :
    PACKAGE_NAME | UNIT_TYPE | UNIT_NAME | START_LINE | END_LINE
    =============================================
    A | PROCEDURE | P1 | 20 | 345
    A | FUNCTION | F1 | 347 | 629
    etc..
    2. Start PL/SQL package execution.
    3. Keep dumping call stack snapshots whenever a custom debug procedure is called.
    4. Dump the package name and line number to a log file.
    5. Using the package name and line number, query the table built in step 1 and build the final report which shows the control flow in a readable form.
    What we want is to get rid of step 5 and by some means get the logic to extract the unit type and name in step 4 itself.
    Keep them coming..
    Thanks and regards,
    Shashank

  • Can I print the File name and page number

    When printing a file, I would like to print the File Name and the page number also...something like a header, in every page printed.  Is this possible in Acrobat?  Please advise.
    Thanks

    Sure. Did you look under Tools - Pages - Header & Footer ?

  • "File with specified name and version number already exists. Result code= -48."   ...????

    Recently I have been getting this error message when I try to record an audio track in Logic... "File with specified name and version number already exists. Result code = -48."  WHAT IS THE PROBLEM?????? It's making me furious!

    Hi
    As the message says, there is a file at the recording directory that has the same name:
    http://support.apple.com/kb/ht1618
    Try changing the name of the track (this sets the filename in later versions of Logic 9
    CCT

  • Dynamic File Name and File size

    Hi All
    I need some help in calling Dynamic File Name and Dynamic File size of a file in my adapter Module.
    Could you please provided some help on the same?
    I have tried the same through UDF it is working. Could anyone provide me the steps for the same
    Regards
    Abhishek Mahajan

    Hi,
    You can use the already available adapter module "DynamicConfigurationBean". Have this adapter module at the top of the module list in CC.
    Have the parameter value as insert http://sap.com/xi/XI/System/File FileName and http://sap.com/xi/XI/System/File SourceFileSize (corresponding to the key names)
    For more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/45/da2239feb22e98e10000000a155369/frameset.htm
    There is also a SAP note available for the same....dont remember the note number:(.....
    Regards,
    Abhishek.

  • How to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    how to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    Within Aperture you have Images, which are constructed on-the-fly from two files (the Master and the Version).  You get an image-format file _only_ when you export an Image.  You select the file name (usually a scheme) when you create an image-format file (that is, when you export).  Look under "Aperture→Presets→File Naming" for built-in Presets.  You can, of course, create your own or customize any provided.
    The Preset is applied to only the file newly created by your "export" command.  It is not applied to the Image in Aperture (unless you rename your Versions or your Masters).

  • Replacing Host Name and Port number throughout Environments

    So I am currently working on a project that have several classes using simple JDBC code. I'm switching all of it to use JNDI instead of what is currently being used. I'm using Weblogic and the plan is to have the code run in a cluster.
    Here is a code Snippet of some of the code.
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,
    "t3://hostname:port");
    My problem lies in the the "t3://hostname:port" String. I don't want to hardcode that since I know its bad code practice but my question is what is the best way to replace that with the Host Name and Port number as I move environments. Should I have a Class with a Static Variable and just reference that through the other classes or should I put it in some Property file and read the value from there? Any insight into this would be greatly appreciated.
    Thank you.

    would it be something like this?
    Properties properties = new Properties();
              try {
         properties.load(new FileInputStream("src/jndi.properties"));
         String url = properties.getProperty("url");
         System.out.println(url );
         } catch (IOException e) {
         }

  • I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Can I add the file name and page numbers to multiple pdfs automatically?

    Hello.  Thanks first for taking the time to read this!  We are a small non profit hospice.  Looking to take a large amount of files and put the patients last name (which is the file name) and a page number on the footer of every page of every document.  For example.  File Name Smith.  Smith 1 Smith 2 Smith 3 etc.  However I like to be able to do this to multiple files at once and not have to open each one up.

    Go to Advanced - Document Processing - Batch Processing...
    Click New Sequence and give it a name.
    Now select the sequence you've created, click Edit Sequence, click Select Commands.
    Select Execute JavaScript from the left-hand side, and click Add.
    Now select it on the right-hand side and click Edit.
    Paste the code from my previous post into the window, and click OK twice.
    Now, back in the Edit Sequence window, select the folder you want to run the batch on, and the output folder. Be aware that if you choose the same folder, the original files will be overwritten, so you might want to use a different one.
    Under Source File Options, deselect everything.
    Click OK.
    You're now ready to run the batch sequence!

  • Aperture keeps asking for my name and serial number

    Aperture keeps asking for my name and serial number, but only on one of my Macs. This is a new Mac that I restored from my old Mac. It made sense to have to put in the documentation the first time, but the program keeps asking for it. Any thoughts?

    Be sure to enter the serial number, when you are logged in from an account with Administrator priveleges - otherwise the serial number cannot be stored.
    Aperture is installed for all users on your mac, so the serial number is written to the system library, not the user library; this requires read/write access for administrators. Do you enter your serial number using an administrator account?
    SInce you migrated your system from another mac, you still may have an older ProAppSystemID file or Aperture cannot write to the System Library.
    To stop Aperture asking for the serial number, first check, if you still have an old file "ProAppsSystemID" in your System Library.
    Quit Aperture.
    Go to your MacintoshHD and open the folder "Library", then "Application Support", then "ProApps".
    Remove the File "ProAppsSystemID" to the Desktop, if it exist and restart Aperture.
    Reenter your serial number, hopefully for the last time.
    Sometimes Aperture writes this file to a temporary directory, when it cannot write to the Library. If the above does not work, look at the temporary directory /tmp
    Use the Finder's "Go" menu
         Go > Got to folder    and  enter /tmp into the textfield. If you see ProAppsSystemID there, move it to its proper location in /Library/Application Support/ProApps.
    Aperture must be running, and you will have to wait a few minutes to be seeing the file appearing the /tmp directory.
    Regards
    Léonie

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • Vendor name and Vedor number in FAGLL03

    Hi All,
    My Client is running report for GR/IR, T-code FAGLL03, they want to see Vendor name and Vendor number columns in the report. I searched forums and got the answer for Vendor number but not clear
    My questions are
    1. I added field LIFNR in BSEG table in the SPRO and am able to see the vendor colum. If I transport to Test system, will I be able to see the vendor column? (in forums some one mentioned that they are not able to see the vendor column when they transport to Test system) they have been asked to run this program BALVBUFDEL, So I am concerned about this issue and want to know exactly what are the things that need to be done, what programs have to be run before transporting to Test system?
    Also we are using ECC 6.0 and the highest support package present in the system is SAPKGPAD15. So I dont think I need to install the OSS note 1034354, I checked the OSS note and the highest APPL level is 604? but just making sure about this Patch level and OSS note.
    2. Second, how to get the Vendor name cloumn in the report?
    Could someone give me solution? your help will be really appreciated.
    Thanks,
    Harter
    Edited by: Harter21 on Nov 8, 2009 2:57 AM
    Edited by: Harter21 on Nov 8, 2009 2:58 AM

    Hi Sanjay,
    Thanks for the reply. I understood that we get Vendor number from the Function module ITEM_STRUC_EXTENSION and when you run that FM it updates the vendor number in the Structure FAGLPOSYEXT. I want to have Vendor name side to Vendor number field. Can I get vendor name also from the same FM?
    I have tried in BSIS table and other OSS notes that are mentioned in that forum link but none of the OSS notes mentioned about the Vendor name and the vendor name is coming from LFA1 table and that has no connection with FAGLL03 report as far as I understand (correct me if I am wrong).
    If you have any idea please throw some light.
    Thank you very much,
    Harter.

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • TA38622 how do you delete a contact name and phone number from this?  i have deleted it from my regular contacts, but it remains in a text memory when i begin to type the beginning of a name

    How do I delete a contact name and phone number from my texting memory?  I have deleted this contact from my regular contact information; however when I text and begin to text a contact beginning with the 1st letter of the name I had deleted, it brings up the old, deleted contact information in my texting history only.

    You would have to restore as new.

Maybe you are looking for

  • Report not show after submit query in parameter form

    Hi, anubody can help me with this report not show after click submit query button in parameter form

  • Help getting Outlook 2007 to sync with proper calendar on Blackberry Curve

    Hi I'm new to this forum and have looked for specific answers but not luck as of yet. I'll try to explain what I need to happen fully so it may seem like I'm rambling. I've recently been issued a new computer with Vista and Outlook 2007 for work. Pre

  • Can't open .3DS files in CS6 extended

    Hi, I'm trying to open .3DS files in Photoshop CS6 extended, but it is giving me the error message: "could not complete your request because 3d functionality is currently disabled due OpenGL being disabled" At first it opened a few files and worked f

  • Support schedule print out for every maintainance contract

    Hi Experts Below is the scenario I create a maintainance contract with below items Contract num:900001    customer:A contract period- 1yr Material           Description                             Qty          Maint fee 12345              car- GMC-fu

  • Time Machine Error and Can't Unmount Disk

    I hope I'm posting this in the right place. I think Leopard must be optimized for Intel Macs, and I'm guessing my problems have to do with using a G5. Anyway, I have a 250G start up drive and a 500G second hard drive which I've been using for Time Ma