C编译器剖析_C类型系统_相容类型Compatible Type

Social-Auto-Upload实战:如何用Python+Playwright实现抖音/B站/小红书一键三连发? 本文详细介绍了如何使用Python和Playwright框架构建Social-Auto-Upload自动化上传工具,实现抖音、B站、小红书等平台的一键多发布。通过模拟真实用户操作和Cookie管理技术,该工具能有效解决内容创作者跨平台发布的重复劳动问题,提升工作效率。 阅读详情

     在前文对函数调用进行语义检查时,我们用函数CanAssign()来判断“能否把实参赋值给形参”,在函数CanAssign中,我们又用宏IsCompatiblePtr来判断两个指针是否相容。而如果指针类型T1 * ptr1和T2 * pt2相容,则意味着类型T1和T2是相容的。UCC编译器中ucl\type.c的函数IsCompatibleType()用于判断类型是否相容,与类型系统相关的数据结构请参见”2.4节 C语言的类型系统”中的各个示意图,而在这一节中,我们要对与IsCompatibleType()相关的几个函数做进一步讨论。我们先举个简单的例子来说明类型相容的概念,以下两个对arr的声明被视为兼容的,其出发点是遇到int arr[]时,我们只是暂时不知道其数组大小,稍后遇到了int arr[3]时,我们知道其数组大小为3,因此以下对arr的两次声明对应的是内存中的同一个数组对象。需要注意的是,以下对于a的两次声明被视为是冲突的,因为int占4字节,double占8字节,两者内部的数据组织形式也不一样,如果硬要规定把a当double来处理,那程序员在分析以下函数f()时,若没有注意到离得比较远的double a,却发现在f()函数中sizeof(a)竟然是8,那其脑门上不知要浮现出多少个问号。但需要注意的是,进行赋值时,我们可以把整型的b赋值给double型的c,这需要编译器进行隐式的类型转换,但不论如何转型,程序员使用变量名b和c时,C编译器与C程序员的约定仍旧是“b对应内存中的一个int类型的变量,而c对应double类型的变量”。虽然在UCC编译器exprchk.c的个别地方用到了IsCompatible()函数,但这个函数主要还是用在declchk.c中,换言之,我们主要是在处理形如int arr[]和int arr[3]的声明时,用IsCompatible()函数来检查一下"同名的两个声明其类型是否相容",后续在分析declchk.c时我们会看到这一点。

         int arr[];            //  相容 compatible

         int arr[3];

int a;                  //  不相容 incompatible

void f(){

   sizeof(a);

}

double a;

int b; double c;  //                  

c = b;

    接下来,我们来分析一下IsCompatible()函数的代码,如图4.2.31所示。图4.2.31第3行用于判断ty1和ty2是否指向同一个struct type对象,如果是,则为相同类型的对象,自然就是彼此兼容的;否则还需要进一步判断。

介绍七种常见还危险的病毒(带样本) 简介:能够感染用户计算机bai系统中的.exe、.dll和.html文件,将自身加密以后缀加到目标文件中。样本(源文件):https://wwx.lanzoux.com/iJx4njrpz1c / https://wwx.lanzoui.com/iYRNLwd8ldc。英文名称:Virus.Win32.Viking.A(标准) / Worm.Win32.Fujack.A(标准)英文名称:Net-Worm.Win32.Blaster.A(标准)/ Lovesan.A/ Msblast.A。 阅读详情

相关推荐

PLSQL Developer新手必看:如何避免安装过程中的常见坑

本文为PL/SQL Developer新手提供了详尽的安装与配置避坑指南。从版本选择、注册码使用、汉化包安装到Oracle客户端连接配置,逐一解析常见问题并提供解决方案,帮助开发者快速搭建稳定的PL/SQL开发环境,顺利开启Oracle数据库编程工作。

g9h0i1的博客 649

Spec-Kit实战:用‘规范驱动开发’重构一个老旧Node.js项目(避坑指南)

本文详细介绍了如何使用Spec-Kit工具通过‘规范驱动开发’(SDD)重构老旧Node.js项目。从逆向工程提取规范到增量改造策略,再到避免典型陷阱,提供了实战指南和避坑技巧,帮助开发者高效实现架构现代化,显著提升代码质量和维护效率。

weixin_42525582的博客 553

手机相机基础技术解析:从硬件到算法的全面指南

手机相机的成像过程可简化为的链路,其核心硬件包括 镜头、CMOS传感器、ISP(图像信号处理器) 以及配套的软件算法。

weixin_44239603的博客 2447

嵌入式开发必备:UART、RS232、RS485通信协议实战对比(附代码示例)

本文从嵌入式开发实战角度,深度对比了UART、RS232和RS485三种核心串行通信协议。详细解析了它们的工作原理、硬件连接、代码配置及典型应用场景,并提供了基于通信距离、节点数量和电磁环境的三维度选型指南,帮助开发者根据项目需求做出最优技术决策。

i0j1k2l3m的博客 474

全志DRM框架下LVDS双屏异显配置实战

本文详细介绍了在全志DRM框架下配置LVDS双屏异显的实战经验。涵盖硬件连接、内核配置、设备树修改、背光控制及U-Boot适配等关键步骤,重点解析屏参转换技巧与双屏route配置,帮助开发者解决工业控制台等多屏应用中的显示适配问题,提升开发效率。

rnn9storyteller的博客 811

QT实现HTTP文件(夹)下载的完整流程与实战技巧

本文详细介绍了使用QT框架实现HTTP文件和文件夹下载的完整流程与实战技巧。通过QNetworkAccessManager等核心类,讲解了从单文件下载、大文件处理、进度显示、暂停/取消功能,到复杂的文件夹下载策略。文章重点剖析了断点续传、错误处理与网络健壮性等关键问题,为C++桌面应用集成稳定高效的下载功能提供了专业指导。

weixin_29239279的博客 277

《YOLO多模态创新改进专栏目录 》全网独家创新,多模态融合改进教程,包含早期融合、中期融合、后期融合、损失函数改进、二次创新模块、独家创新等几百种创新点改进,答疑群提供完整项目,永久更新中

🔥《YOLO多模态创新改进专栏》重磅来袭!🚀 本专栏汇集最新顶会顶刊创新点,提供1000+篇YOLO多模态改进方案(涵盖v8-v26),包含: 多模态融合策略(早期/中期/后期) 损失函数优化 独家创新模块 详细改进步骤 ✨特色服务: ✔️ 配套完整可运行项目 ✔️ 专业答疑群支持(含非计算机专业指导) ✔️ 持续更新至2026年 ✔️ 适用目标检测/OBB/分割/分类等多任务 💡适合人群: 科研人员 | 研究生 | 需发SCI/CCF论文者 环境要求宽松,新手友好,助力快速产出科研成果! 📈早订优

Ai缝合怪、助力小伙伴高效发论文 742

MT4/MT5 第三代移动平均线(MetaTrader 指标)

第三代移动平均线(3G-MA)是传统MA指标的升级版本,通过"时滞压缩"算法将信号滞后降至理论极限(λ=2)。该指标在保留平滑性的同时,信号速度比EMA快1.5-2.3倍,适用于MT4/MT5平台。核心参数包括计算周期(默认34)、滞后压缩系数(2-10)和应用价位选择,支持斜率变色功能。安装简单,无需外部依赖,通过多周期共振可提升12-18%胜率。指标代码包含完整的MT4/MT5实现方案,采用双缓冲计算结构,通过相位前移算法抵消群延迟。风险提示:需配合其他技术指标和严格风控(≤2%账户

JanLEE 578

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

上一篇: C编译器剖析_4.2 语义检查_表达式的语义检查(5)_结构体成员选择
下一篇: C编译器剖析_4.2 语义检查_表达式的语义检查(6)_一元运算符表达式
SheIsC
博客等级 码龄12年 224粉丝 64原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值