Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Disable ASSERTS

Disable ASSERTS

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingtutorialquestion
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    misha_grewal
    wrote on last edited by
    #1

    How to disable all the ASSERTS that come when u execute a program in Debug mode?I require it very urgently. The ASSERT i m getting are in timecore.cpp and i have no idea how to remove them. But they are occurring so frequently that its difficult to operate on the debug mode application. Any comiler setting or macro which would disable all ASSERTs from popping up? Any ideas about ASSERTS in timecore.cpp?

    C R L 3 Replies Last reply
    0
    • M misha_grewal

      How to disable all the ASSERTS that come when u execute a program in Debug mode?I require it very urgently. The ASSERT i m getting are in timecore.cpp and i have no idea how to remove them. But they are occurring so frequently that its difficult to operate on the debug mode application. Any comiler setting or macro which would disable all ASSERTs from popping up? Any ideas about ASSERTS in timecore.cpp?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The ASSERTs are telling you something, you should listen to them. You could try redefining ASSERT, and see if that works out for you. Or undefine DEBUG, but then you may as well go to release mode. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

      R 1 Reply Last reply
      0
      • M misha_grewal

        How to disable all the ASSERTS that come when u execute a program in Debug mode?I require it very urgently. The ASSERT i m getting are in timecore.cpp and i have no idea how to remove them. But they are occurring so frequently that its difficult to operate on the debug mode application. Any comiler setting or macro which would disable all ASSERTs from popping up? Any ideas about ASSERTS in timecore.cpp?

        R Offline
        R Offline
        rpins
        wrote on last edited by
        #3

        Most ASSERT macros (I'm assuming you're using some Microsoft version of them) are enabled in debug compilations and then nullified for release versions. In other words, an ASSERT macro might be defined like this: #ifdef _DEBUG #define ASSERT(expr) ...some assert code... #else #define ASSERT(expr) #endif Notice how the second ASSERT defition has nothing after it. That's because in non-debug builds, you don't want assertions to do anything. So, to possibly answer your question, you should probably dig up where your ASSERT is being defined and do #undef _DEBUG (to undefine debug build). Unfortunately, that turns off most debug features since many things test against _DEBUG being defined. Either do that, or compile as release, or create your own ASSERT macro based on other example code. HTH

        1 Reply Last reply
        0
        • M misha_grewal

          How to disable all the ASSERTS that come when u execute a program in Debug mode?I require it very urgently. The ASSERT i m getting are in timecore.cpp and i have no idea how to remove them. But they are occurring so frequently that its difficult to operate on the debug mode application. Any comiler setting or macro which would disable all ASSERTs from popping up? Any ideas about ASSERTS in timecore.cpp?

          L Offline
          L Offline
          l a u r e n
          wrote on last edited by
          #4

          ummmmm how about fixing the cause of the ASSERT's? just a wild stupid idea i know but im old fashioned like that :rolleyes:


          "there is no spoon"
          biz stuff   about me

          P M 2 Replies Last reply
          0
          • L l a u r e n

            ummmmm how about fixing the cause of the ASSERT's? just a wild stupid idea i know but im old fashioned like that :rolleyes:


            "there is no spoon"
            biz stuff   about me

            P Offline
            P Offline
            Prakash Nadar
            wrote on last edited by
            #5

            I already told him to do that in the previous post but he says he has no time to do that(that was 3-4 days back), if he had taken some time off to fix the problem then his prob would have been solved. I Touched Osama Bin Ladens Bushy Beard

            1 Reply Last reply
            0
            • C Christian Graus

              The ASSERTs are telling you something, you should listen to them. You could try redefining ASSERT, and see if that works out for you. Or undefine DEBUG, but then you may as well go to release mode. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

              R Offline
              R Offline
              Rob Manderson
              wrote on last edited by
              #6

              Christian Graus wrote: The ASSERTs are telling you something, you should listen to them Uh huh :) Some of my friends complain when I sprinkle my code liberally with ASSERT and ASSERT_KINDOF but I almost never have problems with NULL pointers or pointers to objects of the wrong kind. Even the act of writing the assertion gets the background threads thinking about whether I'm calling something with the correct (and validated) pointers :) Rob Manderson http://www.mindprobes.net **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

              1 Reply Last reply
              0
              • L l a u r e n

                ummmmm how about fixing the cause of the ASSERT's? just a wild stupid idea i know but im old fashioned like that :rolleyes:


                "there is no spoon"
                biz stuff   about me

                M Offline
                M Offline
                misha_grewal
                wrote on last edited by
                #7

                Thnks, I finally fixed the ASSERT. :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups