@@ -357,8 +357,8 @@ __CPROVER_HIDE:;
357
357
358
358
inline int strcmp (const char * s1 , const char * s2 )
359
359
{
360
- __CPROVER_HIDE :;
361
- #ifdef __CPROVER_STRING_ABSTRACTION
360
+ __CPROVER_HIDE :;
361
+ #ifdef __CPROVER_STRING_ABSTRACTION
362
362
int retval ;
363
363
__CPROVER_precondition (__CPROVER_is_zero_string (s1 ),
364
364
"strcmp zero-termination of 1st argument" );
@@ -369,13 +369,16 @@ inline int strcmp(const char *s1, const char *s2)
369
369
__CPROVER_assume (retval != 0 );
370
370
371
371
return retval ;
372
- #else
372
+ #else
373
373
__CPROVER_size_t i = 0 ;
374
374
unsigned char ch1 , ch2 ;
375
375
do
376
376
{
377
+ # pragma CPROVER check push
378
+ # pragma CPROVER check disable "conversion"
377
379
ch1 = s1 [i ];
378
380
ch2 = s2 [i ];
381
+ # pragma CPROVER check pop
379
382
380
383
if (ch1 == ch2 )
381
384
{
@@ -389,7 +392,7 @@ inline int strcmp(const char *s1, const char *s2)
389
392
}
390
393
while (ch1 != 0 && ch2 != 0 );
391
394
return 0 ;
392
- #endif
395
+ #endif
393
396
}
394
397
395
398
/* FUNCTION: strcasecmp */
@@ -403,8 +406,8 @@ inline int strcmp(const char *s1, const char *s2)
403
406
404
407
inline int strcasecmp (const char * s1 , const char * s2 )
405
408
{
406
- __CPROVER_HIDE :;
407
- #ifdef __CPROVER_STRING_ABSTRACTION
409
+ __CPROVER_HIDE :;
410
+ #ifdef __CPROVER_STRING_ABSTRACTION
408
411
int retval ;
409
412
__CPROVER_precondition (__CPROVER_is_zero_string (s1 ),
410
413
"strcasecmp zero-termination of 1st argument" );
@@ -415,13 +418,16 @@ inline int strcasecmp(const char *s1, const char *s2)
415
418
__CPROVER_assume (retval != 0 );
416
419
417
420
return retval ;
418
- #else
421
+ #else
419
422
__CPROVER_size_t i = 0 ;
420
423
unsigned char ch1 , ch2 ;
421
424
do
422
425
{
426
+ # pragma CPROVER check push
427
+ # pragma CPROVER check disable "conversion"
423
428
ch1 = s1 [i ];
424
429
ch2 = s2 [i ];
430
+ # pragma CPROVER check pop
425
431
426
432
if (ch1 >='A' && ch1 <='Z' ) ch1 += ('a' - 'A' );
427
433
if (ch2 >='A' && ch2 <='Z' ) ch2 += ('a' - 'A' );
@@ -438,7 +444,7 @@ inline int strcasecmp(const char *s1, const char *s2)
438
444
}
439
445
while (ch1 != 0 && ch2 != 0 );
440
446
return 0 ;
441
- #endif
447
+ #endif
442
448
}
443
449
444
450
/* FUNCTION: strncmp */
@@ -452,23 +458,26 @@ inline int strcasecmp(const char *s1, const char *s2)
452
458
453
459
inline int strncmp (const char * s1 , const char * s2 , size_t n )
454
460
{
455
- __CPROVER_HIDE :;
456
- #ifdef __CPROVER_STRING_ABSTRACTION
461
+ __CPROVER_HIDE :;
462
+ #ifdef __CPROVER_STRING_ABSTRACTION
457
463
__CPROVER_precondition (__CPROVER_is_zero_string (s1 ) ||
458
464
__CPROVER_buffer_size (s1 )>=n ,
459
465
"strncmp zero-termination of 1st argument" );
460
466
__CPROVER_precondition (__CPROVER_is_zero_string (s2 ) ||
461
467
__CPROVER_buffer_size (s2 )>=n ,
462
468
"strncmp zero-termination of 2nd argument" );
463
- #else
469
+ #else
464
470
__CPROVER_size_t i = 0 ;
465
471
unsigned char ch1 , ch2 ;
466
472
if (n == 0 )
467
473
return 0 ;
468
474
do
469
475
{
476
+ # pragma CPROVER check push
477
+ # pragma CPROVER check disable "conversion"
470
478
ch1 = s1 [i ];
471
479
ch2 = s2 [i ];
480
+ # pragma CPROVER check pop
472
481
473
482
if (ch1 == ch2 )
474
483
{
@@ -482,7 +491,7 @@ inline int strncmp(const char *s1, const char *s2, size_t n)
482
491
}
483
492
while (ch1 != 0 && ch2 != 0 && i < n );
484
493
return 0 ;
485
- #endif
494
+ #endif
486
495
}
487
496
488
497
/* FUNCTION: strncasecmp */
@@ -496,23 +505,26 @@ inline int strncmp(const char *s1, const char *s2, size_t n)
496
505
497
506
inline int strncasecmp (const char * s1 , const char * s2 , size_t n )
498
507
{
499
- __CPROVER_HIDE :;
500
- #ifdef __CPROVER_STRING_ABSTRACTION
508
+ __CPROVER_HIDE :;
509
+ #ifdef __CPROVER_STRING_ABSTRACTION
501
510
int retval ;
502
511
__CPROVER_precondition (__CPROVER_is_zero_string (s1 ),
503
512
"strncasecmp zero-termination of 1st argument" );
504
513
__CPROVER_precondition (__CPROVER_is_zero_string (s2 ),
505
514
"strncasecmp zero-termination of 2nd argument" );
506
515
return retval ;
507
- #else
516
+ #else
508
517
__CPROVER_size_t i = 0 ;
509
518
unsigned char ch1 , ch2 ;
510
519
if (n == 0 )
511
520
return 0 ;
512
521
do
513
522
{
523
+ # pragma CPROVER check push
524
+ # pragma CPROVER check disable "conversion"
514
525
ch1 = s1 [i ];
515
526
ch2 = s2 [i ];
527
+ # pragma CPROVER check pop
516
528
517
529
if (ch1 >='A' && ch1 <='Z' ) ch1 += ('a' - 'A' );
518
530
if (ch2 >='A' && ch2 <='Z' ) ch2 += ('a' - 'A' );
@@ -529,7 +541,7 @@ inline int strncasecmp(const char *s1, const char *s2, size_t n)
529
541
}
530
542
while (ch1 != 0 && ch2 != 0 && i < n );
531
543
return 0 ;
532
- #endif
544
+ #endif
533
545
}
534
546
535
547
/* FUNCTION: strlen */
0 commit comments