Skip to content

Commit

Permalink
Define NDEBUG in src/MakeFile to disable asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
mungre committed Jun 11, 2024
1 parent dcbbbde commit a2193cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TARGET := ../beebasm
# Define compiler switches

WARNFLAGS := -Wall -W -Wcast-qual -Werror -Wshadow -Wcast-align -Wold-style-cast -Woverloaded-virtual
CXXFLAGS := -O3 -pedantic $(WARNFLAGS)
CXXFLAGS := -O3 -pedantic -DNDEBUG $(WARNFLAGS)

# Define linker switches

Expand Down
2 changes: 2 additions & 0 deletions src/discimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ DiscImage::DiscImage( const char* pOutput, const char* pInput )
endSectorAddr = 2;
}

#ifndef NDEBUG
m_inputFile.seekg( 0, ios::end );
int length = static_cast< int >( m_inputFile.tellg() );
m_inputFile.seekg( 0, ios::beg );

assert( length >= endSectorAddr * 0x100 );
#endif

char sector[ 0x100 ];

Expand Down

0 comments on commit a2193cb

Please sign in to comment.