<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; would you plz tee me wat is to be don e in this case</title>
	<atom:link href="https://www.emblogic.com/blog/tag/would-you-plz-tee-me-wat-is-to-be-don-e-in-this-case/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>ISO C90 forbids mixed declarations and code</title>
		<link>https://www.emblogic.com/blog/03/iso-c90-forbids-mixed-declarations-and-code/</link>
		<comments>https://www.emblogic.com/blog/03/iso-c90-forbids-mixed-declarations-and-code/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 04:43:00 +0000</pubDate>
		<dc:creator><![CDATA[zaffer]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[would you plz tee me wat is to be don e in this case]]></category>

		<guid isPermaLink="false">http://emblogic.org/blog/?p=2207</guid>
		<description><![CDATA[make -C /lib/modules/2.6.36.4/build M=/home/zaffer/linux modules make[1]: Entering directory `/usr/src/linux-2.6.36.4&#8242; CC [M] /home/zaffer/linux/lko.o /home/zaffer/linux/lko.c: In function ‘start’: /home/zaffer/linux/lko.c:36:10: warning: ISO C90 forbids mixed declarations and code// WAT IS THE ABOVE LINE?&#8230;&#8230;&#8230;.//&#8230;&#8230;&#8230;&#8230;####### Building modules, stage 2. MODPOST 1 modules WARNING: &#8220;scull_open&#8221; [/home/zaffer/linux/lko.ko] &#8230; <a href="https://www.emblogic.com/blog/03/iso-c90-forbids-mixed-declarations-and-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>make -C /lib/modules/2.6.36.4/build M=/home/zaffer/linux modules<br />
make[1]: Entering directory `/usr/src/linux-2.6.36.4&#8242;<br />
CC [M] /home/zaffer/linux/lko.o<br />
/home/zaffer/linux/lko.c: In function ‘start’:<br />
/home/zaffer/linux/lko.c:36:10: warning: ISO C90 forbids mixed declarations and code// WAT IS THE ABOVE LINE?&#8230;&#8230;&#8230;.//&#8230;&#8230;&#8230;&#8230;#######<br />
Building modules, stage 2.<br />
MODPOST 1 modules<br />
WARNING: &#8220;scull_open&#8221; [/home/zaffer/linux/lko.ko] undefined!<br />
CC /home/zaffer/linux/lko.mod.o<br />
LD [M] /home/zaffer/linux/lko.ko<br />
make[1]: Leaving directory `/usr/src/linux-2.6.36.4&#8242;</p>
<p>HEADER FILE<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include</p>
<p>#define SCULL_MAJOR 0</p>
<p>#define SCULL_MINOR 0</p>
<p>#define device_name &#8220;ZAFFER&#8221;</p>
<p>#define device_no 1</p>
<p>#define NO_OF_DEVICES 1</p>
<p>#ifndef DEBUG<br />
#define DEBUG<br />
#endif</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;defining file_operations&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>int scull_open(struct inode*,struct file*);<br />
//int scullrelease(struct inode*, struct file* );</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.end of functions&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.major mainor&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>static int scull_major = SCULL_MAJOR;<br />
static int scull_minor = SCULL_MINOR;<br />
//&#8230;&#8230;&#8230;&#8230;.. &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.structs and declerations&#8230;&#8230;&#8230;&#8230;..<br />
const struct file_operations fops={<br />
.open = scull_open,<br />
// release: scullrelease<br />
};<br />
struct Scull_dev{</p>
<p>struct cdev cdev;</p>
<p>};<br />
struct Scull_dev *sculldev;</p>
<p>//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;end of declerations&#8230;&#8230;&#8230;&#8230;.<br />
MODULE_AUTHOR(&#8220;Zaffer&#8221;);<br />
MODULE_LICENSE(&#8220;GPL&#8221;);<br />
//&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
55,1</p>
<p>LKO.C<br />
int reg;<br />
printk(KERN_INFO &#8220;Begin : %s\n&#8221;,__func__);<br />
printk(KERN_INFO&#8221; HELLO KERNEL&#8221;);<br />
printk(KERN_INFO &#8220;GREAT&#8221;);<br />
if(scull_major)<br />
{<br />
dev=MKDEV(scull_major,scull_minor);<br />
reg=register_chrdev_region(dev,scull_major,device_name);<br />
}<br />
else<br />
{</p>
<p>reg=alloc_chrdev_region(&amp;dev,scull_major,device_no,device_name);<br />
scull_major=MAJOR(dev);<br />
}<br />
if(regcdev.owner=THIS_MODULE;<br />
sculldev-&gt;cdev.ops=&amp;fops;<br />
cdev_init(&amp;(sculldev-&gt;cdev),&amp;fops );<br />
int scull_open(struct inode *inode, struct file *filp)<br />
{<br />
// #ifdef DEBUG<br />
// printk(KERN_INFO &#8220;open function performed sucessfully\n&#8221;);<br />
- // #endif<br />
return 0;<br />
}<br />
cdev_add(&amp;(sculldev-&gt;cdev),dev,1);<br />
return 0;<br />
}<br />
void __exit release(void)<br />
{<br />
#ifdef DEBUG<br />
printk(KERN_INFO &#8220;exit : %s\n&#8221;,__func__);<br />
#endif</p>
<p>printk(KERN_INFO &#8220;BYE KERNEL&#8221;);<br />
unregister_chrdev_region(dev,device_no);<br />
kfree(sculldev);<br />
cdev_del(&amp;(sculldev-&gt;cdev));</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/iso-c90-forbids-mixed-declarations-and-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
