comparison src/lisp.h @ 5820:b3824b7f5627

Some changes to eliminate warnings with Apple clang version 1.7. src/ChangeLog addition: 2014-10-18 Aidan Kehoe <kehoea@parhasard.net> Some changes to eliminate warnings with Apple clang version 1.7. * cm.c (send_string_to_tty_console): * doprnt.c (doprnt_2): * doprnt.c (parse_off_posnum): * event-stream.c (dribble_out_event): Cast various calls to Lstream_putc() to void when the result isn't being used, for the sake of clang. * lisp.h: Declare #'replace here too, it's used in event-stream.c. * lisp.h (ALLOCA): * lisp.h (MALLOC_OR_ALLOCA): Cast a couple of zeros in the context of the ternary operator to void to prevent unused value warnings with clang. * sysdep.c (child_setup_tty): * text.h (ASSERT_ASCTEXT_ASCII_LEN): Use DO_NOTHING in these files to quieten the compiler. lib-src/ChangeLog addition: 2014-10-18 Aidan Kehoe <kehoea@parhasard.net> * ootags.c (substitute): Cast the result of strlen to int before comparing it with a signed value, for the sake of compiler warnings.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 18 Oct 2014 21:48:10 +0100
parents a216b3c2b09e
children 5d5aeb79edb4
comparison
equal deleted inserted replaced
5819:ba0ff364bd94 5820:b3824b7f5627
1361 NOTE: The use of a global temporary like this is unsafe if ALLOCA() occurs 1361 NOTE: The use of a global temporary like this is unsafe if ALLOCA() occurs
1362 twice anywhere in the same expression; but that seems highly unlikely. The 1362 twice anywhere in the same expression; but that seems highly unlikely. The
1363 alternative is to force all callers to declare a local temporary if the 1363 alternative is to force all callers to declare a local temporary if the
1364 expression has side effects -- something easy to forget. */ 1364 expression has side effects -- something easy to forget. */
1365 1365
1366 #define ALLOCA(size) \ 1366 #define ALLOCA(size) \
1367 (REGEX_MALLOC_CHECK (), \ 1367 (REGEX_MALLOC_CHECK (), \
1368 __temp_alloca_size__ = (size), \ 1368 __temp_alloca_size__ = (size), \
1369 __temp_alloca_size__ > MAX_ALLOCA_VS_C_ALLOCA ? \ 1369 __temp_alloca_size__ > MAX_ALLOCA_VS_C_ALLOCA ? \
1370 xemacs_c_alloca (__temp_alloca_size__) : \ 1370 xemacs_c_alloca (__temp_alloca_size__) : \
1371 (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \ 1371 (need_to_check_c_alloca ? xemacs_c_alloca (0) : (void) 0, \
1372 alloca (__temp_alloca_size__))) 1372 alloca (__temp_alloca_size__)))
1373 1373
1374 /* Version of ALLOCA() that is guaranteed to work inside of function calls 1374 /* Version of ALLOCA() that is guaranteed to work inside of function calls
1375 (i.e., we call the C alloca if regular alloca() is broken inside of 1375 (i.e., we call the C alloca if regular alloca() is broken inside of
1376 function calls). */ 1376 function calls). */
1395 } 1395 }
1396 1396
1397 /* WARNING: If you use this, you must unbind_to() at the end of your 1397 /* WARNING: If you use this, you must unbind_to() at the end of your
1398 function! */ 1398 function! */
1399 1399
1400 #define MALLOC_OR_ALLOCA(size) \ 1400 #define MALLOC_OR_ALLOCA(size) \
1401 (REGEX_MALLOC_CHECK (), \ 1401 (REGEX_MALLOC_CHECK (), \
1402 __temp_alloca_size__ = (size), \ 1402 __temp_alloca_size__ = (size), \
1403 __temp_alloca_size__ > MAX_ALLOCA_VS_MALLOC ? \ 1403 __temp_alloca_size__ > MAX_ALLOCA_VS_MALLOC ? \
1404 xmalloc_and_record_unwind (__temp_alloca_size__) : \ 1404 xmalloc_and_record_unwind (__temp_alloca_size__) : \
1405 (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \ 1405 (need_to_check_c_alloca ? xemacs_c_alloca (0) : (void) 0, \
1406 alloca (__temp_alloca_size__))) 1406 alloca (__temp_alloca_size__)))
1407 1407
1408 /* -------------- convenience functions for memory allocation ------------- */ 1408 /* -------------- convenience functions for memory allocation ------------- */
1409 1409
1410 #define countof(x) ((int) (sizeof(x)/sizeof((x)[0]))) 1410 #define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
5768 Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object); 5768 Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object);
5769 extern Fixnum warn_about_possibly_incompatible_back_references; 5769 extern Fixnum warn_about_possibly_incompatible_back_references;
5770 5770
5771 /* Defined in sequence.c */ 5771 /* Defined in sequence.c */
5772 EXFUN (Ffill, MANY); 5772 EXFUN (Ffill, MANY);
5773 EXFUN (Freplace, MANY);
5773 5774
5774 /* Defined in signal.c */ 5775 /* Defined in signal.c */
5775 void init_interrupts_late (void); 5776 void init_interrupts_late (void);
5776 5777
5777 /* Defined in sound.c */ 5778 /* Defined in sound.c */