LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-28-2009, 03:18 AM   #1
kk2202
LQ Newbie
 
Registered: Jan 2009
Posts: 24

Rep: Reputation: 15
Switches controlling the code compilation -- How to


Hi,

I had been working on a CPP code for sometime now, without being aware that some parts of its code, especially security related were not being compiled.

Problem was like my product did not work for SSL mode. On analysis, I found that some part of CPP codes inside a switch(ENABLE_SSL_LIBRARY)were not getting compiled at all. And also that this gets set when we do newgrp crypto command on the box.

This left me without lots of doubts. I wanted to understand how these switches work and if this switch was propreitary to my code or something related to Linux.

My questions now are:

1. Switches like the one mentioned above , are they user defined, for my particular code or are they related to Linux/GCC or makefiles?

2.If a user can define such switches to control code compilation, then need to know the concepts/procedures behind it. How is it done ?

Kindly excuse if these are very very basic. But since I could not get proper stuffs on google, I thought I should ask some experts here who could either explain me or point me to appropriate resources (links of articles / tutorials)
 
Old 08-28-2009, 11:18 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,541

Rep: Reputation: 878Reputation: 878Reputation: 878Reputation: 878Reputation: 878Reputation: 878Reputation: 878
Is that a switch like the C control structure switch? I would guess that the compiler can figure out the value of ENABLE_SSL_LIBRARY at compile time so it decides that some cases of the switch will never be taken and they don't need to be compiled. Hard to say for sure without more context. gcc will warn about such cases if you pass the -Wunreachable-code option to it.

Quote:
And also that this gets set when we do newgrp crypto command on the box.
What does "this" refer to here?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation problem in c++ template code :( lali.p Programming 2 10-13-2008 07:44 PM
D-ITG compilation error - me or the code? baldy3105 Linux - Software 2 12-08-2006 05:47 AM
compilation error - code 2 jhon Programming 2 08-31-2004 02:54 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Newbie 1 01-21-2004 07:43 AM
[Pure-ftpd] Debian compilation switches ?? eriov Linux - Software 2 01-20-2004 01:36 PM


All times are GMT -5. The time now is 09:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration