Skip to content

Commit c8714a9

Browse files
committed
Addressing clang warning about switch in seekoff not containing all cases
1 parent 3a9ff16 commit c8714a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Release/include/cpprest/filestream.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "cpprest/fileio.h"
3333
#include "cpprest/astreambuf.h"
3434
#include "cpprest/streams.h"
35+
#include <assert.h>
3536

3637
#ifndef _CONCRT_H
3738
#ifndef _LWRCASE_CNCRRNCY
@@ -663,7 +664,9 @@ namespace details {
663664
return (pos_type)_seekrdpos_fsb(m_info, size_t(m_info->m_rdpos+offset), sizeof(_CharType));
664665
case std::ios_base::end:
665666
return (pos_type)_seekrdtoend_fsb(m_info, int64_t(offset), sizeof(_CharType));
666-
break;
667+
default:
668+
// Fail on invalid input (_S_ios_seekdir_end)
669+
assert(false);
667670
}
668671
}
669672
else if ( (m_info->m_mode & std::ios::ios_base::app) == 0 )
@@ -676,7 +679,9 @@ namespace details {
676679
return (pos_type)_seekwrpos_fsb(m_info, size_t(m_info->m_wrpos+offset), sizeof(_CharType));
677680
case std::ios_base::end:
678681
return (pos_type)_seekwrpos_fsb(m_info, size_t(-1), sizeof(_CharType));
679-
break;
682+
default:
683+
// Fail on invalid input (_S_ios_seekdir_end)
684+
assert(false);
680685
}
681686
}
682687
return (pos_type)traits::eof();

0 commit comments

Comments
 (0)