gcc -v以及-h处理

GCC:gcc/gcov-tool.c

/* Process args, return index to first non-arg.  */

static int process_args (int argc, char **argv) {   int opt;

  while ((opt = getopt_long (argc, argv, "+hv", options, NULL)) != -1)     {       switch (opt)         {         case 'h':           print_usage (false);           /* Print_usage will exit.  */         case 'v':           print_version ();           /* Print_version will exit.  */         default:           print_usage (true);           /* Print_usage will exit.  */         }     }

  return optind; }

/* Print a usage message and exit.  If ERROR_P is nonzero, this is an error,    otherwise the output of --help.  */

static void print_usage (int error_p) {   FILE *file = error_p ? stderr : stdout;   int status = error_p ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE;

  fnotice (file, "Usage: %s [OPTION]... SUB_COMMAND [OPTION]...\n\n", progname);   fnotice (file, "Offline tool to handle gcda counts\n\n");   fnotice (file, "  -h, --help                            Print this help, then exit\n");   fnotice (file, "  -v, --version                         Print version number, then exit\n");   print_merge_usage_message (error_p);   print_rewrite_usage_message (error_p);   print_overlap_usage_message (error_p);   fnotice (file, "\nFor bug reporting instructions, please see:\n%s.\n",            bug_report_url);   exit (status); }

 

/* Print version information and exit.  */

static void print_version (void) {   fnotice (stdout, "%s %s%s\n", progname, pkgversion_string, version_string);   fnotice (stdout, "Copyright %s 2014-2016 Free Software Foundation, Inc.\n",            _("(C)"));   fnotice (stdout,            _("This is free software; see the source for copying conditions.\n"              "There is NO warranty; not even for MERCHANTABILITY or \n"              "FITNESS FOR A PARTICULAR PURPOSE.\n\n"));   exit (SUCCESS_EXIT_CODE); }

static const struct option options[] = {   { "help",                 no_argument,       NULL, 'h' },   { "version",              no_argument,       NULL, 'v' },   { 0, 0, 0, 0 } };

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在GD32F460系列单片机中移植mbedtls-v3.4.0库的AES和RSA加密算法,你需要按照以下步骤进行操作: 1. 下载mbedtls-v3.4.0库:从mbedtls官方网站(https://tls.mbed.org/)下载mbedtls-v3.4.0库的源代码。 2. 配置GD32F460开发环境:根据GD32F460系列单片机的开发环境,配置编译工具链(如GCC)和相应的开发环境。 3. 移植AES加密算法: - 将mbedtls/library/aes.c和mbedtls/include/mbedtls/aes.h两个文件复制到你的GD32F460项目中的对应目录下。 - 在你的项目中包含aes.c和aes.h文件,并进行编译和链接。 4. 移植RSA加密算法: - 将mbedtls/library/rsa.c、mbedtls/library/bignum.c和mbedtls/include/mbedtls/rsa.h、mbedtls/include/mbedtls/bignum.h四个文件复制到你的GD32F460项目中的对应目录下。 - 在你的项目中包含rsa.c、bignum.c、rsa.h和bignum.h文件,并进行编译和链接。 5. 配置编译选项:在你的GD32F460项目中,确保已经启用了适当的编译选项,例如启用了C标准库和适当的优化级别。 6. 修改配置文件:根据GD32F460系列单片机的内存和性能限制,适当调整mbedtls库的配置文件,例如`mbedtls/config.h`文件。你可以根据需要禁用不需要的功能或调整缓冲区大小等。 7. 编写测试代码:使用GD32F460的开发环境编写测试代码,调用mbedtls库中的AES和RSA函数进行加密和解密操作。 请注意,以上步骤提供了一个基本的指导,具体的移植过程可能因项目的具体要求和开发环境而有所不同。在移植过程中,你可能还需要处理其他依赖项、适配底层接口和处理与GD32F460硬件相关的特定细节。 建议参考mbedtls的官方文档和示例代码,以获取更详细的移植指南和使用说明。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值