printf("consumer %d read from pool\n", (int)arg);
printf("producer %d write to pool\n", (int)arg);
//创建生产者线程pthread_create(&producer_id[i], NULL, producer_fun, (void *)i);//创建消费者线程pthread_create(&consumer_id[i], NULL, consumer_fun, (void *)i);

在生产者消费者问题中发现错误,最后发现原因是系统由于长度问题不支持这么转换,但是可以这么解决:

  • (int)arg = *(int *)arg

  • (void *)i = &i

printf("consumer %d read from pool\n", *(int *)argarg);
printf("producer %d write to pool\n", *(int *)argarg);
//创建生产者线程pthread_create(&producer_id[i], NULL, producer_fun, &i);//创建消费者线程pthread_create(&consumer_id[i], NULL, consumer_fun, &i);

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]相关推荐

  1. assignment makes pointer from integer without a...

    2019独角兽企业重金招聘Python工程师标准>>> warning: assignment makes pointer from integer without a cast 今 ...

  2. java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer

    java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer 1.改sql select ...

  3. java.lang.Long cannot be cast to java.lang.Integer解决办法

    情景: mybatis连接oracle 报错: 测试增的时候,报错 Java.lang.Long cannot be cast to  java.lang.Integer:删改没有报错. 排查过程: ...

  4. 关于Object数组强转成Integer数组的问题:Ljava.lang.Object; cannot be cast to [Ljava.lang.Integer;...

    一.当把Object数组,强转的具体的Integer数组时,会报错. 代码如下: //数组强转报错演示 Object[] numbers = {1,2,3};Integer[] ints = (Int ...

  5. java.math.BigDecimal cannot be cast to java.lang.Integer

    问题描述:利用sql语句从数据库里面取出数据后,对取出的数据进行数据转换时,出现了java.math.BigDecimal cannot be cast to java.lang.Integer错误, ...

  6. mysql biginteger java_java.math.BigInteger cannot be cast to java.lang.Integer以及mysql升级的问题...

    java.math.BigInteger cannot be cast to java.lang.Integer以及mysql升级的问题 Mysql 8.0 原因是mysql升级到8.0,数据库驱动使 ...

  7. java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Integer;

    报这个错是因为集合转换数组时出错 错误写法: List userIdList = new ArrayList(); Integer[] array = (Integer[]) userIdList.t ...

  8. java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Integer

    1.问题代码 HashSet<Integer> currentProgrammeIds = new HashSet<>();currentProgrammeIds.add(1) ...

  9. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

    在开发中,遇到这么一个错误: 报错的意思: Long 无法转化成Integer类型. 网上的解释是:     这里在Hibernate2.0之前版本list.get(0)返回的是Integer类型.但 ...

  10. java.lang.Class Cast Exception: com.lidroid.xutils.bitmap.core.Async Drawable cannot be cast to andr

    如果使用xutils加载图片的朋友可能有的时候用上这种圆图处理会报异常 在其中加上这个判断就OK了 if(drawable instanceof BitmapDrawable){ b = ((Bitm ...

最新文章

  1. C# 多线程 参数传递
  2. 巨杉数据库通过“Mpp数据库基础能力认证”,权威技术认证金融级数据库
  3. Androd开发之通过ComponentName和setComponent以及scheme打开外部应用 | 打开任意页面 | 打开指定页面
  4. oracle的导出参数statistic,使用expdp导出时评估所需存储容量大小
  5. linux mariadb 乱码,MariaDB插入中文数据乱码解决过程
  6. HashMap 中的一个“坑”!
  7. P1789 【Mc生存】插火把(python3实现)
  8. 如何在Eclipse中添加Servlet-api.jar的方法
  9. c++date数据类型_PLC编程设涉及到的数据类型了解一下
  10. MySQL Date and Time Functions(日期和时间)
  11. GIT 之概述与架构
  12. 推荐一个PPT挣钱路子,日赚800-1000元
  13. 热血江湖游戏中断开服务器,为什么最近老是一进去游戏就提示与服务器断开 – 手机爱问...
  14. Leetcode每日一题 面试题56 - I.数组中数字出现的次数
  15. 计算机管理中误删用户,win10管理员账户删除了怎么解决?
  16. 《启示录:打造用户喜爱的产品》第一部分 人员5 产品管理与软件开发
  17. PseudoSeg: Designing Pseudo Labels for Semantic Segmentation阅读笔记
  18. SQL语句操作练习(一)
  19. solr mysql dih_Solr结构化数据导入DIH
  20. Linux系列之CentOS系统安装

热门文章

  1. python3--输入厘米转为英寸英寸
  2. 如何在Mac上打开和使用AirPlay,以便在更大的显示器上进行屏幕镜像?
  3. globk命令帮助信息
  4. 单反拍摄技巧:利用直方图曝光
  5. mysql比较两个表数据的差异_mysql实用技巧之比较两个表是否有不同数据的方法分析...
  6. 嵌入式和单片机不一样?
  7. Java基础——时间和日期
  8. 我国有了密码法,将2020年1月1日起施行!
  9. eaxsinbx_二次微分方程的通解
  10. STM32单片机基础知识总结(二)