Menu

MCPP on HP-UX

2008-01-10
2013-05-28
  • Dwayne Boone

    Dwayne Boone - 2008-01-10

    Hi,

    I recently started using MCPP on HP-UX and ran into a couple of issues. I have also found solutions to these issues and hope these changes might make it into a future release of MCPP.

    1. Use of FILENAME_MAX

    On HP-UX FILENAME_MAX is defined to be only 14, which needless to say causes issues for MCPP. Instead of FILENAME_MAX it would be desirable if MCPP code could use PATH_MAX instead. This allows MCPP to work properly on HP and it would still be portable across all other platforms was well.

    2. configure test for long long printf modifier

    The code that checks for the printf long long modifier does not work with the HP-UX C compiler (cc). The code currently looks like the following:

    int main( void)
    {   char    buf[ 20];
        long long  num = "1234567890123456789";
        sprintf( buf, "%${modifier}d", num);
        assert( strcmp( buf, "1234567890123456789") == 0);
        exit( 0);
    }

    By simply changing the test code to the following everything works fine with HP C compiler.

    int main( void)
    {   char    buf[ 20];
        long long  num;
        sscanf("1234567890123456789", "%${modifier}d", &num);
        sprintf( buf, "%${modifier}d", num);
        assert( strcmp( buf, "1234567890123456789") == 0);
        exit( 0);
    }

    Again this change should also work without issue on all other platforms.

    It would be great if these two changes could be incorporated into the next version of MCPP.

    Regards,
    Dwayne

     
    • Kiyoshi Matsui

      Kiyoshi Matsui - 2008-01-11

      Thank you for the information on HP-UX cc.

      1. I will use PATH_MAX instead of FILENAME_MAX whenever it is available.

      2. Also I will change to use sscanf() in the testing routine for printf()
      long long modifier in configure.

      I will incorporate these changes in the next revision of SVN trunk.

       

Log in to post a comment.