run_warn.cpp 610 B

123456789101112131415161718
  1. // (C) Copyright Beman Dawes 2003. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying file
  3. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. // Test naming convention: the portion of the name before the tilde ("~")
  5. // identifies the bjam test type. The portion after the tilde
  6. // identifies the correct result to be reported by compiler_status.
  7. // provoke one or more compiler warnings
  8. int main(int argc, char * argv[] )
  9. {
  10. short s;
  11. unsigned long ul;
  12. s = s & ul; // warning from many compilers
  13. if ( s == ul ) {} // warning from GCC
  14. return 0;
  15. }
粤ICP备19079148号